headwind icon indicating copy to clipboard operation
headwind copied to clipboard

Order classes on @apply on .css and .sccs files

Open filipesmedeiros opened this issue 4 years ago • 5 comments

Is your feature request related to a problem? Please describe. No problem.

Additional context Just do exactly the same, but in front of @apply in .css (and friends) files.

I can try to help if you point me in the right direction!

filipesmedeiros avatar Mar 31 '20 01:03 filipesmedeiros

I would expect we could do something like this…

"headwind.classRegex": {
    "css": "(?<=apply).*[^\\;]",
    "postcss": "(?<=apply).*[^\\;]",
 }

…but to be clear: this does not work.

I'm guessing that Headwind is specifically looking inside of HTML elements and not looking inside a plain line of code (or in this case a CSS definition).

rareyman avatar Apr 30 '20 20:04 rareyman

Works fine for me in *.pcss after I've duplicated css regex as postcss and restarted VS Code

"headwind.classRegex": {
  "css": "\\B@apply\\s+([_a-zA-Z0-9\\s\\-\\:\\/]+);",
  "postcss": "\\B@apply\\s+([_a-zA-Z0-9\\s\\-\\:\\/]+);",  
}

lxSm8qn0lb

Xeevis avatar Jan 13 '21 16:01 Xeevis

I don't understand how this works. How is "postcss" mapped to "*.pcss"? What is the list of possible file type keys?

In my case I want it to work on *.sass files (which it doesn't). What should I add?

memark avatar May 28 '21 06:05 memark

I don't understand how this works. How is "postcss" mapped to "*.pcss"? What is the list of possible file type keys?

https://code.visualstudio.com/docs/languages/identifiers

In my case I want it to work on *.sass files (which it doesn't). What should I add?

In that case I think you should use scss. Not 100% sure but you won't waste much time trying it out :wink:

hacknug avatar May 30 '21 14:05 hacknug

Bump 👋🏽 Would be great to get this working on pre-compiled CSS and SCSS files.

ghost avatar Sep 12 '23 14:09 ghost