docs: clarify style precedence

pull/16158/head
7nik 3 months ago
parent 6a7df1cce8
commit 3480d53252

@ -34,8 +34,10 @@ To mark a style as important, use the `|important` modifier:
<div style:color|important="red">...</div>
```
When `style:` directives are combined with `style` attributes, the directives will take precedence:
When `style:` directives are combined with `style` attributes, the directives will take precedence,
even over `!important` properties:
```svelte
<div style="color: blue;" style:color="red">This will be red</div>
<div style:color="red" style="color: blue">This will be red</div>
<div style:color="red" style="color: blue !important">This will still be red</div>
```

Loading…
Cancel
Save