astroturfcss / astroturf

Better Styling through Compiling: CSS-in-JS for those that want it all.
https://astroturfcss.github.io/astroturf/
MIT License
2.28k stars 59 forks source link

Any idea how to auto format css between stylesheet tags? #719

Closed mcmichaelchan closed 3 years ago

mcmichaelchan commented 3 years ago

Hey there, thanks for the amazing library! I'd like to know how to format CSS between stylesheet tags using prettier or other tools? Thx :) image

jquense commented 3 years ago

This is a bit out of our hands at the moment. Prettier hard codes template tags it considers inline CSS, and ATM there is no way to configure that. I believe the plan is to make this extension via plugins or options but that hasn't happened yet. In the meantime you may want to ask them to add stylesheet or you may want to just use css (or rename stylesheet to css) if you don't need both in the same file: import {stylesheet as css} from '...'

mcmichaelchan commented 3 years ago

This is a bit out of our hands at the moment. Prettier hard codes template tags it considers inline CSS, and ATM there is no way to configure that. I believe the plan is to make this extension via plugins or options but that hasn't happened yet. In the meantime you may want to ask them to add stylesheet or you may want to just use css (or rename stylesheet to css) if you don't need both in the same file: import {stylesheet as css} from '...'

Aha! It works, thx :)