docs: clarify style precedence (#16158)

Co-authored-by: 7nik <kifiranet@gmail.com>
pull/16159/head
7nik 3 months ago committed by GitHub
parent 6636f748ae
commit 5c5536eaa1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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