Replies: 1 comment 5 replies
-
I think since it would be quite clunky to handle reactivity (style tags aren't really made for this) it could only preprocess an initial value which would be limiting and confusing. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently CSS is pretty standard, or we can use a preprocessor to get some extra features but overall, it is fairly limited. However, we can fully manipulate inline styles by adding JavaScript, so why not allow this functionality in the actual style part of the svelte file? It wouldn't be pure CSS but neither is much of the special HTML we use. We could also make standalone stylesheets like this +style.css.svelte or something like that so the preprocessor knows to process them. This would make it much easier to manipulate styles. The final compiled code could just inline all the styles to keep reactivity. Supposedly Inline styles are faster anyway.
for example, this is valid:
but this isn't:
Beta Was this translation helpful? Give feedback.
All reactions