Skip to content

Commit c4167b7

Browse files
sync svelte docs
1 parent 1d6dbf6 commit c4167b7

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

apps/svelte.dev/content/docs/svelte/03-template-syntax/17-style.md

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

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:
3940

4041
```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>
4244
```

apps/svelte.dev/content/docs/svelte/07-misc/02-testing.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@ test('Effect', () => {
130130
// effects normally run after a microtask,
131131
// use flushSync to execute all pending effects synchronously
132132
flushSync();
133-
expect(log.value).toEqual([0]);
133+
expect(log).toEqual([0]);
134134

135135
count = 1;
136136
flushSync();
137137

138-
expect(log.value).toEqual([0, 1]);
138+
expect(log).toEqual([0, 1]);
139139
});
140140

141141
cleanup();
@@ -149,17 +149,13 @@ test('Effect', () => {
149149
*/
150150
export function logger(getValue) {
151151
/** @type {any[]} */
152-
let log = $state([]);
152+
let log = [];
153153

154154
$effect(() => {
155155
log.push(getValue());
156156
});
157157

158-
return {
159-
get value() {
160-
return log;
161-
}
162-
};
158+
return log;
163159
}
164160
```
165161

0 commit comments

Comments
 (0)