ap / vim-css-color

Preview colours in source code while editing
http://www.vim.org/scripts/script.php?script_id=5056
MIT License
1.77k stars 78 forks source link

support for svelte files #165

Open ns740 opened 2 years ago

ns740 commented 2 years ago

please add support for .svelte files

i've kludged a fix in my copy of the plugin as suggested in issue 153 by copying the after/syntax/css.vim file to after/syntax/svelte.vim

this basically works on css that appears between <style></style> tags but i am not confident to submit this as a PR because it seems there is a more thorough and correct way to do this. (Should i use "runtime" and refer to the existing .css file instead? What about typescript in svelte files? - should the svelte config reference the typescript configs some way?). I am clearly out of my depth.

ap commented 2 years ago

A bit more info would be useful – until now I wasn’t aware of Svelte… which is presumably what you are asking about?

I find evanleck/vim-svelte and leafOfTree/vim-svelte-plugin for that – are you using one of those? If you have any sense of this, would you say they are both popular? Do people use something else?

Oddly, the way those plugins are constructed and the way CSS Color is built, I think it should be getting loaded automagically already, in which case your issue would be a bug rather than a feature request. But this is preliminary only as I haven’t done any testing yet and may find I was misremembering or overlooking something once I do.

ns740 commented 2 years ago

A bit more info would be useful

apologies

svelte files have html, javascript and css styling all together in one file.
javascript is between Githubissues.

  • Githubissues is a development platform for aggregating issues.