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

style cannot be post-processed #26

Open
kingyue737 opened this issue May 29, 2024 · 0 comments
Open

style cannot be post-processed #26

kingyue737 opened this issue May 29, 2024 · 0 comments

Comments

@kingyue737
Copy link
Contributor

kingyue737 commented May 29, 2024

CSS in this project is injected by js via vite-plugin-css-injected-by-js, and thus it cannot be post-processed by PostCSS or lightningCSS on the user end.

For example, this project injects prefixes that may not be needed by users targeting the latest browsers. If the styles can be post-processed on the user end, those unnecessary styles will be removed by PostCSS to reduce bundle size.

On the other hand, this project uses some features that are not supported on old browsers like inset and percentage in opacity, both of which have a global usage of less than 95% https://caniuse.com/mdn-css_properties_inset. The users that target older browsers will need PostCSS to transpile them.

As a library, I think it would be better to build styles into a .css dist file instead of a js string.

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