Skip to content

Make component CSP safe #2057

@cyantree

Description

@cyantree

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 setting style-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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions