-
My use case is that I wanted to use expressions in a The docs made it sound like putting it in a So far this is the only thing that has worked, but it's clumsy AF: <svelte:element this={'style'}>
:root {
color-scheme: {colorScheme};
}
</svelte:element> (I’m aware I can do the same thing via DOM manipulation, this has become a quest in itself at this point 😁 ) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Are you looking for {@html `
<style>
:root {
color-scheme: ${colorScheme};
}
</style>
`} |
Beta Was this translation helpful? Give feedback.
-
I did a little bit of history digging, and it seems like expressions in non-top-level styles did work in Svelte v1 (ages ago!), but the feature was removed in Svelte v2: #1339 Part of the reason it was removed seemed to be the trickiness of parsing I guess it could be a valid feature request to make this work again, though it may be closed for some of the reasons in the above issue. Until then, the best workaround is probably #10686 (comment) |
Beta Was this translation helpful? Give feedback.
Are you looking for
@html
?