Skip to content
Merged

sync #492

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ The `{@const ...}` tag defines a local constant.
{/each}
```

`{@const}` is only allowed as an immediate child of a block — `{#if ...}`, `{#each ...}`, `{#snippet ...}` and so on — or a <Component />.
`{@const}` is only allowed as an immediate child of a block — `{#if ...}`, `{#each ...}`, `{#snippet ...}` and so on — or a `<Component />`.
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ Svelte's implementation is essentially syntactic sugar for adding a wrapper elem
Desugars to this:

```svelte
<div style="display: contents; --rail-color: black; --track-color: rgb(0, 0, 255)">
<svelte-css-wrapper style="display: contents; --rail-color: black; --track-color: rgb(0, 0, 255)">
<Slider bind:value min={0} max={100} />
</div>
</svelte-css-wrapper>
```

For SVG namespace, the example above desugars into using `<g>` instead:
Expand All @@ -207,7 +207,7 @@ For SVG namespace, the example above desugars into using `<g>` instead:
</g>
```

> [!NOTE] Since this is an extra `<div>` (or `<g>`), beware that your CSS structure might accidentally target this. Be mindful of this added wrapper element when using this feature.
> [!NOTE] Since this is an extra `<svelte-css-wrapper>` (or `<g>`), beware that your CSS structure might accidentally target this. Be mindful of this added wrapper element when using this feature.

Svelte's CSS Variables support allows for easily themeable components:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,5 @@ Reading state that was created inside the same derived is forbidden. Consider us
### state_unsafe_mutation

```
Updating state inside a derived or logic block expression is forbidden. If the value should not be reactive, declare it without `$state`
Updating state inside a derived or a template expression is forbidden. If the value should not be reactive, declare it without `$state`
```
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Reading state that was created inside the same derived is forbidden. Consider us
### state_unsafe_mutation

```
Updating state inside a derived or logic block expression is forbidden. If the value should not be reactive, declare it without `$state`
Updating state inside a derived or a template expression is forbidden. If the value should not be reactive, declare it without `$state`
```


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Reading state that was created inside the same derived is forbidden. Consider us
### state_unsafe_mutation

```
Updating state inside a derived or logic block expression is forbidden. If the value should not be reactive, declare it without `$state`
Updating state inside a derived or a template expression is forbidden. If the value should not be reactive, declare it without `$state`
```


Expand Down
Loading