Skip to content

Commit

Permalink
Change top level requirement wording (#7336)
Browse files Browse the repository at this point in the history
Changed the wording to be more consistent between `<svelte:window>`, `<svelte:body>` and `<svelte:head>`.
Chose "may only appear" over "has to appear" as the latter could be misinterpreted as a compulsory element
  • Loading branch information
TzuHsuan authored Apr 8, 2022
1 parent 42905c7 commit 535a1fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions site/content/docs/02-template-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -1683,7 +1683,7 @@ All except `scrollX` and `scrollY` are readonly.

Similarly to `<svelte:window>`, this element allows you to add listeners to events on `document.body`, such as `mouseenter` and `mouseleave`, which don't fire on `window`. It also lets you use [actions](/docs#template-syntax-element-directives-use-action) on the `<body>` element.

`<svelte:body>` also has to appear at the top level of your component.
As with `<svelte:window>`, this element may only appear the top level of your component and must never be inside a block or element.

```sv
<svelte:body
Expand All @@ -1704,7 +1704,7 @@ Similarly to `<svelte:window>`, this element allows you to add listeners to even

This element makes it possible to insert elements into `document.head`. During server-side rendering, `head` content is exposed separately to the main `html` content.

As with `<svelte:window>` and `<svelte:body>`, this element has to appear at the top level of your component and cannot be inside a block or other element.
As with `<svelte:window>` and `<svelte:body>`, this element may only appear at the top level of your component and must never be inside a block or element.

```sv
<svelte:head>
Expand Down

0 comments on commit 535a1fc

Please sign in to comment.