Repository navigation
feat: render no <style> elements, for CSP without unsafe-inline - #3318
Merged
interactivellama merged 8 commits intoNov 24, 2026
Merged
Conversation
interactivellama
force-pushed
the
feat/v11-asks-2-csp
branch
from
November 18, 2026 23:29
d83c4ea to
a039683
Compare
interactivellama
changed the base branch from
master
to
feat/v11-llm-4-deprecated-lint
November 18, 2026 23:29
interactivellama
force-pushed
the
feat/v11-asks-2-csp
branch
from
November 19, 2026 04:41
a039683 to
127821d
Compare
interactivellama
force-pushed
the
feat/v11-asks-2-csp
branch
from
November 19, 2026 22:07
127821d to
c889eae
Compare
interactivellama
force-pushed
the
feat/v11-asks-2-csp
branch
from
November 20, 2026 00:14
c889eae to
8e954ae
Compare
interactivellama
force-pushed
the
feat/v11-asks-2-csp
branch
3 times, most recently
from
November 20, 2026 23:43
b94f3d9 to
8778f47
Compare
interactivellama
force-pushed
the
feat/v11-asks-2-csp
branch
from
November 20, 2026 23:51
8778f47 to
63dffb0
Compare
With tooltipMenuItem, List rendered a <style> element, which a Content-Security-Policy without 'unsafe-inline' for style-src blocks. It restyled links that the Tooltip's trigger wrapper had moved out of SLDS's `.slds-dropdown__item > a` rules. The item now renders the tooltip next to the link instead of around it, opens it on hover and focus, and points it at the link with onRequestTargetElement, so SLDS styles the link like any other item and no extra CSS is needed. A template's own isOpen still controls the tooltip. Adds a MenuDropdown WithTooltips story.
With hasAnchoredNubbin, Tooltip rendered a per-id <style> element to hide the dialog's nubbin, which a Content-Security-Policy without 'unsafe-inline' for style-src blocks. The internal Dialog now takes isNubbinHidden: it keeps the nubbin offset so the tooltip doesn't move, but leaves out the slds-nubbin_* class, so there is nothing to hide.
interactivellama
force-pushed
the
feat/v11-asks-2-csp
branch
from
November 23, 2026 03:12
63dffb0 to
e2c3211
Compare
File rendered injectMoreActionsStyles()'s <style> element whenever moreActionsDropdown was set, which a Content-Security-Policy without 'unsafe-inline' for style-src blocks. The trigger wraps the button, so SLDS's button-group :first-child rule rounded its left corners. slds-button_last is SLDS's own class for a dropdown at the end of a button group and rounds the right ones. The a::before/::after background reset overrode nothing in SLDS 1 or 2 and is dropped. File.injectMoreActionsStyles() is public, so it stays, deprecated, and returns null. Adds a Files WithActions story.
Mount every story into jsdom and check that the document has no <style> elements, which a Content-Security-Policy without 'unsafe-inline' for style-src blocks. This covers open menus and portals, which the ReactDOMServer snapshots miss.
CHANGELOG: the three components that no longer render <style> (Changed) and File.injectMoreActionsStyles (Deprecated).
no-style-elements mounts every story, which replays their deprecation and Modal app-element warnings, and the tooltip browser test passed its trigger as the deprecated children. The console guard from #3322 counts both. Mock console in the story sweep, restoring it after cleanup since unmounting a Modal warns too, and pass the tooltip trigger through trigger.
interactivellama
force-pushed
the
feat/v11-asks-2-csp
branch
from
November 23, 2026 05:14
e2c3211 to
8ec6f16
Compare
Niznikr
approved these changes
Nov 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the v11 merge train, stack 3 "GA requirements": asks-2 CSP → SLDS 2 CSS fixes → asks-4 perf → perf improvements → per-component CSS (experimental, last).
Additional description
MenuDropdownwithtooltipMenuItem,TooltipwithhasAnchoredNubbin, andFilewithmoreActionsDropdo <img width="1124" height="548" alt="files-no-title-with-actions" src="https://github.com/user-attachments/assets/7c160e9a-a5ad-42fb-937d-2908ea7824c1" /> wnrendered<style>elements. A Content-Security-Policy without'unsafe-inline'instyle-srcblocks those. Each now uses SLDS markup instead, with no extra stylesheet:TooltipwithhasAnchoredNubbinMenuDropdownwithtooltipMenuItemFilewithmoreActionsDropdownli's direct child, so SLDS's.slds-dropdown__item > arules apply. The tooltip renders next to the link, opens on hover and focus, and points at the link withonRequestTargetElement. Adds aMenuDropdownWithTooltips story.DialogtakesisNubbinHidden. It keeps the nubbin offset but leaves out theslds-nubbin_*class, so there is nothing to hide.slds-button_last.File.injectMoreActionsStyles()is public, so it stays, deprecated, and returnsnull. Adds a Files WithActions story.<style>element. This covers open menus and portals, which the SSR snapshots miss.This PR has no breaking changes. The tooltip menu item's DOM changes, but its roles and accessible names don't.
CONTRIBUTOR checklist (do not remove)
Please complete for every pull request.
Green gate — all of these must pass locally (CI runs the same):
npm run lintpasses with 0 errors (npm run lint:fixto auto-fix). Warnings are the tracked gradual-migration backlog; do not add new errors.npm run typecheckis clean (tsc --noEmit).npm test -- --runpasses — this runs both Vitest projects (jsdomunit+ real-browserbrowser) and the story HTML snapshots. If you changed rendered markup on purpose, update snapshots withnpm test -- --run -uand review the diff.npm run buildsucceeds (type-check + Vite library build +.d.ts+ entry shims).Behavior & docs:
components/button/__tests__). New props and bug fixes should get a regression test. Tests that genuinely need a real browser (focus traversal, layout/measurement, canvas) go in a*.browser.test.jsxfile (thebrowserproject); everything else is jsdom.npm run storybook→ http://localhost:6007/. Confirm the story actually renders and behaves (deprecated Storyshots/Karma are gone; there is no separate browser-tests server).content/visualPickerFigure, render props likerenderItem,iconprops,events), not assumptions — a common source of "component looks broken" reports has been stories authored against the wrong API. Cross-check againstcomponents/<name>/__examples__..d.ts(they're generated by the build); JS consumers rely on them via editor type-acquisition.REVIEWER checklist (do not remove)
CIworkflow: lint, typecheck, test, build). Chromatic visual review, if configured, has been checked.components/__tests__/__snapshots__/story-snapshots.test.jsx.snap).@salesforce/design-system-react/components/<name>and nested paths resolve for ESM, CJS, and types). Removing/renaming a public component or export is a breaking change →feat!:/BREAKING CHANGE:and a major version bump.