windicss-intellisense
windicss-intellisense copied to clipboard
Extract classes into @apply directive in the corresponding place
Hi folks !
I'm thinking about a great feature that miss with Tailwind : select a class (the text cursor in the class attribute) and do a command that will take all classes and extract it into the best place. With Vue or Svelte, inside the style block. Otherwise, in another file. The classe name have to be written by the user in sync with the classe attributes value. And so, classes are extracted as well !
If I have time, I will try to code something. But I'll need help !!
#8
extraction of all classes into external file already exists as commands. maybe you can hook into it
can you elaborate how this can be done? at least in the plugin documentation i did not see such a command :)
@eikaramba it is still a feature yet to be implemented, not had time to tackle this
ahh okay, no problem. i will try at the weekend whether i understand the code and help out, as i would like to have this ;)
the existing commands for extracting style, just put them into an css file
so to resolve #8 and this issue, we would based on editor opened file put the code generated similar to the existing commands into the exiting / or new <style> </style>
tag. another idea is to just add this code into clipboard maybe, then user can paste wherever they need it
https://github.com/windicss/windicss-intellisense/blob/c382ae08cb7390bf47dcd12e9185d124ea9c9ffe/src/lib/commands.ts#L18-L53