-
-
Notifications
You must be signed in to change notification settings - Fork 474
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
Feature Request: add a "priority" option to allow defining the order of style blocks #17
Comments
I hope I can avoid this. You can enforce the order with the If you want to override bootstrap styles, |
Umm, If I add multiple |
@forivall @Ciantic Personally, I think relying on order is a poor and fragile practice - which thus should be avoided. What if you shuffle styles during refactoring? What if you use optimizations such as https://github.com/ben-eb/postcss-merge-idents, https://github.com/ben-eb/postcss-merge-rules and https://github.com/hail2u/node-css-mqpacker ? What if you need to append stylesheets lazily to the dom? |
Yes, I had an error, I did my importing in wrong place! E.g.
when it should be:
So my problem was simply fixed by moving the importing of scss in top. |
Closing because it's possible to do this yourself by changing the import order. |
Changing the import order wouldn't help in the case where modules are lazy loaded. A module which is loaded later will insert the style tag below the last one, and override all the styles. This is more of a problem in development, since in production one usually uses ExtractTextPlugin to concatenate css files in proper order. Using |
@pastelsky I was curious if you found a solution to specify an order for imports. I would essentially like to have certain 3rd party imports be placed at the top, then followed by my application specific imports. |
I'm afraid not @jgornick . In my case, it was just a couple of rules that were not playing well, and I added a This is obviously not a viable solution if you have more rules, plus such workarounds also go into production. |
@pastelsky you can also repeat selectors to increase specificity, i.e. |
This would simplify the process of overwriting certain styles defined in external css blocks (eg. overriding bootstrap). Right now, styling will differ by the order in which you require styles if they have conflicting rules.
The text was updated successfully, but these errors were encountered: