feat: allow objects for style attribute
Author: adigubaCreated Dec 25, 2024Updated Sep 14, 2026
Labelsfeature request
Describe the problem
Since https://github.com/sveltejs/svelte/pull/14714, Svelte allow objects/arrays for class attribute.
I think there should be an equivalent for the style attribute, at least for objects (I don't see any usage for array).
Describe the proposed solution
I expect to have something like this :
<div style={{
'font-size': size,
border: "1px solid",
color
}}>
...
</div>This could be easily done by wrapping the object into a function, but I think this could be handheld internaly.
Example :
Importance
nice to have
Source: sveltejs/svelte