File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed
apps/svelte.dev/content/docs/svelte Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -35,8 +35,10 @@ To mark a style as important, use the `|important` modifier:
35
35
<div style:color|important="red">...</div>
36
36
```
37
37
38
- When ` style: ` directives are combined with ` style ` attributes, the directives will take precedence:
38
+ When ` style: ` directives are combined with ` style ` attributes, the directives will take precedence,
39
+ even over ` !important ` properties:
39
40
40
41
``` svelte
41
- <div style="color: blue;" style:color="red">This will be red</div>
42
+ <div style:color="red" style="color: blue">This will be red</div>
43
+ <div style:color="red" style="color: blue !important">This will still be red</div>
42
44
```
Original file line number Diff line number Diff line change @@ -130,12 +130,12 @@ test('Effect', () => {
130
130
// effects normally run after a microtask,
131
131
// use flushSync to execute all pending effects synchronously
132
132
flushSync ();
133
- expect (log . value ).toEqual ([0 ]);
133
+ expect (log).toEqual ([0 ]);
134
134
135
135
count = 1 ;
136
136
flushSync ();
137
137
138
- expect (log . value ).toEqual ([0 , 1 ]);
138
+ expect (log).toEqual ([0 , 1 ]);
139
139
});
140
140
141
141
cleanup ();
@@ -149,17 +149,13 @@ test('Effect', () => {
149
149
*/
150
150
export function logger (getValue ) {
151
151
/** @type {any[]} */
152
- let log = $state ([]) ;
152
+ let log = [] ;
153
153
154
154
$effect (() => {
155
155
log .push (getValue ());
156
156
});
157
157
158
- return {
159
- get value () {
160
- return log;
161
- }
162
- };
158
+ return log;
163
159
}
164
160
```
165
161
You can’t perform that action at this time.
0 commit comments