> The CSS properties are case-insensitive and use `kebab-case`, which requires quoting key's name in JavaScript.
> In order to avoid this, object keys will be 'converted' according to the following rules :
> * Uppercase keys like `COLOR` will be converted to the lowercase format `color`.
> * `camelCase` keys like `fontSize` will be converted to the kebab-case format `font-size`.
> * `snake_case` keys like `border_color` will be converted to the kebab-case format `border-color`.
> Note that this will not apply to key that starts with a double hyphens, because CSS variable don't have naming rules and are case-sensitive (`--myvar` is different from `--myVar`).
> But we can use a double underscores to enable the same rules. Ex: `__myVar` or `__my_var` will be converted to `--my-var`.
If the value is an array, the truthy values are combined, string are passed without change, and array/objects are flatten :
```svelte
<!-- equivalent to <div style="color:red;display:inline;--my-var:0;font-size:2em;background: black"> -->
Svelte also exposes the `StyleValue` type, which is the type of value that the `style` attribute on elements accept. This is useful if you want to use a type-safe class name in component props:
```svelte
<scriptlang="ts">
import type { StyleValue } from 'svelte/elements';
const props: { style: StyleValue } = $props();
</script>
<divstyle={[props.style,{color:'red'}]}>...</div>
```
## The `style:` directive
The `style:` directive provides a shorthand for setting multiple styles on an element.