Prevent reordering css imports
See original GitHub issueSometimes the order of my css imports matters, because it will effect the cascade. Is there a way I can prevent the sort algorithm from operating against my css files and making them alphabetical?
Or maybe there’s a comment I can use to prevent reordering particular sections / files?  For instance in my index.tsx file I need to import my global css file before my app component, again for the cascade.  Prettier itself has no ranged-ignore comments, unfortunately. https://github.com/prettier/prettier/issues/5287
Thanks!
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:16 (5 by maintainers)
 Top Results From Across the Web
Top Results From Across the Web
How to change the Angular Material 2 CSS imports order?
Yes, In Angular material it adds the intern CSS dynamically when the element/component gets load. So, you cannot change its order.
Read more >order - CSS: Cascading Style Sheets - MDN Web Docs
The order CSS property sets the order to lay out an item in a flex or grid container. Items in a container are...
Read more >Disable wordpress reordering functions in backend screen ...
You have to add the following CSS to an admin.css file (name it whatever you like but it has to be a css...
Read more >sort-imports - ESLint - Pluggable JavaScript Linter
js' is corrected to import { a, b } from 'foo.js' ), but multiple lines are not reordered. Options. This rule accepts an...
Read more >Ability to reorder Styles (CSS) in Style Manager Merged
Since I build web apps template in Webflow, having the ability to drag and rearrange the CSS styles created in Style Manager would...
Read more > Top Related Medium Post
Top Related Medium Post
No results found
 Top Related StackOverflow Question
Top Related StackOverflow Question
No results found
 Troubleshoot Live Code
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free Top Related Reddit Thread
Top Related Reddit Thread
No results found
 Top Related Hackernoon Post
Top Related Hackernoon Post
No results found
 Top Related Tweet
Top Related Tweet
No results found
 Top Related Dev.to Post
Top Related Dev.to Post
No results found
 Top Related Hashnode Post
Top Related Hashnode Post
No results found

@adroste, I also agree this is important, enough that I published a fork of this project that includes https://github.com/trivago/prettier-plugin-sort-imports/pull/111, so that side-effect imports are not reordered. You can find that fork at https://www.npmjs.com/package/@ianvs/prettier-plugin-sort-imports, in case it’s useful.
I think a ‘sortCssImports’ option would be great.