Skip to content
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

[CSS] Unnecessarily large CSS file #655

Open
mwskwong opened this issue Dec 21, 2024 · 0 comments
Open

[CSS] Unnecessarily large CSS file #655

mwskwong opened this issue Dec 21, 2024 · 0 comments

Comments

@mwskwong
Copy link

mwskwong commented Dec 21, 2024

Apparently @radix-ui/themes/styles.css includes every single CSS for the library, including unused components and color palettes. Heck even the theme panel CSS is included, while it is supposed to be a dev-only component. This creates a 700KB CSS file (uncompressed) in a "hello world" app in PROD build.

Proposal

Create separate imports for each item

  • Core (utils + non-color related design tokens) - expected to be imported in root
  • Split color palettes (with light and dark mode variants) into individual CSS files - import when needed
  • Split components into individual CSS files - import when needed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant