heybourn / headwind

An opinionated Tailwind CSS class sorter built for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=heybourn.headwind
MIT License
1.38k stars 46 forks source link

Doesn't format on micro sizes #91

Open Dozorengel opened 4 years ago

Dozorengel commented 4 years ago

Describe the bug If there is a class with micro size spacing, like m-0.5, pt-2.5, headwind doesn't format the tag line at all. I use custom defaultSortOrder config with experimental extended spacing scale released in tailwind 1.7.0, added all the missing classes manually.

This bug affects only the current tag line with micro size, the rest of the code is still formatting correctly. I guessed if I remove micro size classes from the config, they'll be assumed as custom classes and will be moved before or after all classes, but it has no result. Perhaps the parser fails during process on tags with dot inside, unfortunately, there are no errors in the console window to analyze.

Upd: I just realized that it also doesn't format if any custom classes from external files applied. For example, if I apply a class from my custom components.scss, headwind stops format all the classes in the current tag. However, it works fine for classes from the css file located in the same folder with html. Btw, I use Angular.

heybourn commented 3 years ago

Unless those micro sizes are specified in your package.json file they'll automatically be assumed as cutom classes and sort to the end of the list. Are you saying that adding these still has no effect?

Dozorengel commented 3 years ago

Unless those micro sizes are specified in your package.json file they'll automatically be assumed as cutom classes and sort to the end of the list. Are you saying that adding these still has no effect?

Indeed, it doesn't work even if I add them into my package.json.