Skip to content

Commit 9bc72e7

Browse files
authored
Apply suggestions from code review
1 parent f7dba51 commit 9bc72e7

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

packages/svelte/messages/compile-warnings/style.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
> Unused CSS selector "%name%"
44
5-
Svelte traverses both the template and the `<style>` tag to find out which of the CSS selectors are actually in use. It will prune (i.e. remove) those selectors which appear unused and warn you about it.
5+
Svelte traverses both the template and the `<style>` tag to find out which of the CSS selectors are not used within the template, so it can remove them.
66

7-
In some situations Svelte may be too strict and you _know_ that the selector is used. In this case, you can use [`:global` or `:global(...)`](global-styles) to prevent them from being pruned.
7+
In some situations a selector may target an element that is not 'visible' to the compiler, for example because it is part of an `{@html ...}` tag or you're overriding styles in a child component. In these cases, use [`:global`](/docs/svelte/global-styles) to preserve the selector as-is:
8+
9+
```svelte
10+
<div class="post">{@html content}</div>
11+
12+
<style>
13+
.post :global {
14+
p {...}
15+
}
16+
</style>
17+
```

packages/svelte/messages/server-errors/lifecycle.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
> `%name%(...)` is not available on the server
44
5-
Certain methods such as `mount` cannot be invoked while running in a server context. Avoid calling them eagerly, i.e. not during the server render.
5+
Certain methods such as `mount` cannot be invoked while running in a server context. Avoid calling them eagerly, i.e. not during render.

0 commit comments

Comments
 (0)