Skip to content

Commit 5c5536e

Browse files
authored
docs: clarify style precedence (#16158)
Co-authored-by: 7nik <[email protected]>
1 parent 6636f74 commit 5c5536e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

documentation/docs/03-template-syntax/17-style.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ To mark a style as important, use the `|important` modifier:
3434
<div style:color|important="red">...</div>
3535
```
3636

37-
When `style:` directives are combined with `style` attributes, the directives will take precedence:
37+
When `style:` directives are combined with `style` attributes, the directives will take precedence,
38+
even over `!important` properties:
3839

3940
```svelte
40-
<div style="color: blue;" style:color="red">This will be red</div>
41+
<div style:color="red" style="color: blue">This will be red</div>
42+
<div style:color="red" style="color: blue !important">This will still be red</div>
4143
```

0 commit comments

Comments
 (0)