Comments (3)
Yes, the Style9Plugin
sorts the generated CSS declarations, as this is required to make the styles deterministic. If you want to avoid this for CSS not generated from style9 you should be able to pass a regex to the plugin: new Style9Plugin({ test: /.../ })
. You'll probably also need to look at the splitChunks and virtualFileName options so that you have something to match against.
This doesn't seem to be related to Create React App specifically, it's more about Webpack in general. I don't use CRA or CRACO so it's unlikely that I'll add a specific plugin for that, but the normal Webpack setup should work.
from style9.
@johanholmerin Could you clarify why it's necessary for style9's styles to be deterministic if webpack generally doesn't care?
Could there be an option for the plugin to only sort it's own CSS by default?
from style9.
It's to make sure that when pseudo classes and at-rules the order which they are generated doesn't affect what styles are applied.
The plugin already tries to only sort the CSS generated by style9, but since it's done after the files are combined it cannot be 100%. The solution is to separate the CSS generated from style9 from other CSS, as explained above.
from style9.
Related Issues (20)
- Generate readable class names in output HOT 1
- Incompatible with ejected create-react-app HOT 2
- Atomic css rule not works when component loaded as lazy HOT 7
- selector parse error HOT 1
- Compress class names HOT 2
- Incompatible with latest version of Next.js HOT 5
- Feature request: support nested selectors HOT 1
- Next.js hot-reload not working for new styles HOT 6
- Incompatible with Vite bundler HOT 8
- Using Next.js _document.js throws error on static export HOT 5
- Breaks with latest version of Next HOT 6
- Issue with webpack plugin on windows HOT 4
- [Feature Request] Transpile away `style9` runtime call HOT 5
- Support for advanced pseudos HOT 2
- Plugin does not work with next-contentlayer HOT 2
- Conflicts when used with Geist UI HOT 1
- Any plans to productionize a Vite plugin? HOT 1
- How to use global styles? HOT 1
- [Feature Request]: Support Vite
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from style9.