VSCode Extension #120
marcomuser
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
Pretty much my exact thoughts. Make an LSP -> Search workspace for webawesome in node_modules -> if not there, cache a copy of webawesome's CSS files from the remote files -> use lightningcss to parse and then pass the tokens and classes along to the LSP. i think it should be possible to forward it the CSS language server. Definitely some research to do for writing the LSP. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
One thing that I'm excited about is the theming system that Web Awesome comes with and uses across it's components. There is a beautiful token system specified as custom properties which on the one hand allow the customization and branding of the components but and on the other also streamline and harmonize the whole website being built.
Having said this, I feel like the DX of using the tokens could be improved by offering intellisense autocompletion support in text editors like VSCode. When I apply a custom property in a css or jsx file, I always have to look up which tokens are available.
I've been experimenting a bit with how this could be improved. A VSCode extension could parse the default.css theme file and extract all custom properties into a Map/Set. Then when the user types var(-- in a css, html, jsx, tsx, vue or svelte file the extension would offer autocompletion with all parsed custom properties. The same could be done for the utility classes when the user types class= or className= in a html, jsx... file.
I've been trying out how simple it is to extract custom properties and utility classes from the default.css and webawesome.css files and it seems to be pretty straightforward when using lightningcss (https://lightningcss.dev/). I'm basically first bundling the css files and then extract the properties I'm interested in with a custom transform. Theoretically, those two files and their imports could be bundled with the extension to make the setup easier.
I'm just having some fun with this thought experiment right now but would be keen to see how others see this topic? :)
Beta Was this translation helpful? Give feedback.
All reactions