Giter VIP home page Giter VIP logo

Comments (3)

johanholmerin avatar johanholmerin commented on May 24, 2024

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.

shravan2x avatar shravan2x commented on May 24, 2024

@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.

johanholmerin avatar johanholmerin commented on May 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.