-
Notifications
You must be signed in to change notification settings - Fork 845
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make component CSP safe #2057
Comments
At a glance, the ideal solution would be to avoid style tag injection here. There are legit use cases where this is not possible though e.g. when we want to improve the SSR first render experience. React Balancer came to mind as their solution requires it. They seem to agree on the |
I'm also seeing this not just for <div style="--radix-popover-content-transform-origin: var(--radix-popper-transform-origin); --radix-popover-content-available-width: var(--radix-popper-available-width); --radix-popover-content-available-height: var(--radix-popper-available-height); --radix-popover-trigger-width: var(--radix-popper-anchor-width); --radix-popover-trigger-height: var(--radix-popper-anchor-height);">
...
</div> I'm not sure if a |
Closed via #2728 |
Feature request
Overview
As discovered in mantinedev/mantine#3597
@radix-ui/react-scroll-area
currently can't be used in a CSP enabled environment without settingstyle-src: unsafe-inline
.By being able to configure a nonce or getting rid of the inline styles this scenario would be possible.
Implementation idea
Provide a property to specify a nonce. This nonce then gets passed to the style tag.
Who does this impact? Who is this for?
This is relevant for applications in CSP enabled environments that use strict rules to enhance security.
Additional context
Inline styles are set here:
https://github.com/radix-ui/primitives/blob/main/packages/react/scroll-area/src/ScrollArea.tsx#L152
The text was updated successfully, but these errors were encountered: