Skip to content

Docs: Clarify correct usage of @radix-ui/themes/styles.css in JS vs CSS files #755

@Prince-Sharma-07

Description

@Prince-Sharma-07

The documentation currently shows this for adding Radix Themes styles:

import "@radix-ui/themes/styles.css";

This works when importing from JavaScript/TypeScript files (e.g. index.tsx, App.tsx, or layout.tsx).

But many developers try to include it inside a global CSS file (like globals.css in Next.js, or a root stylesheet in Vite/CRA/Remix). In that case, the syntax above is invalid, because import is not valid in CSS.

The correct syntax inside CSS files is:

@import "@radix-ui/themes/styles.css";

It would help if the docs clarified both usage patterns to avoid confusion across different frameworks.

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