Skip to content

Commit a695707

Browse files
martrappCopilot
andcommitted
Update sidebar links and enhance documentation on hiding view transition names
Co-authored-by: Copilot <copilot@github.com>
1 parent 89ac8d5 commit a695707

2 files changed

Lines changed: 13 additions & 11 deletions

File tree

astro.config.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,17 @@ function sidebar() {
206206
label: "View Transition Examples",
207207
link: "/basics/examples/",
208208
},
209-
{ label: "Names and Pseudo-Elements", link: "/basics/pseudos/" },
209+
{
210+
label: "Names and Pseudo-Elements", link: "/basics/pseudos/",
211+
badge: { text: "Updated!", variant: "success" } as Badge
212+
},
210213
{
211214
label: "Mechanics of Default Animations",
212215
link: "/basics/default-animations/",
213216
},
214217
{ label: "Styling View Transitions", link: "/basics/styling/" },
215218
{ label: "JavaScript API", link: "/basics/javascript/" },
216-
{ label: "Playing Hide & Seek", link: "/basics/hide-and-seek/",
217-
badge: { text: "Updated!", variant: "success" } as Badge },
219+
{ label: "Playing Hide & Seek", link: "/basics/hide-and-seek/", },
218220
{
219221
label: "API Levels and Implications",
220222
link: "/basics/levels/"
@@ -232,7 +234,7 @@ function sidebar() {
232234
{
233235
label: "Utensil Drawer",
234236
link: "/tools/utensil-drawer/",
235-
},
237+
},
236238
],
237239
},
238240
{

src/content/docs/basics/pseudos.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,19 +172,19 @@ There are two main cases where the View Transition API ignores view transition n
172172

173173
2. The more important case: View transition names are ignored if the element with the `view-transition-name` property is not rendered at the moment the View Transition API captures the images.
174174

175-
### When Names are Ignored
175+
### How to Hide Names
176176

177-
There are several ways to prevent an element from rendering and therefore hide its view transition name.
177+
There are several ways to prevent an element from rendering and therefore hide its view transition name from the API.
178178

179179
On the HTML side, you can hide elements by adding the `hidden` attribute or by placing them inside a closed `<details>` element.
180180

181181
|HTML|Effect|
182182
|-|-|
183183
|`hidden` attribute|Ignores view transition names inside the subtree rooted at the element|
184-
|closed `<details>` element|Ignores view transition names inside the `<details>` element as long as they are not part of the first `<summary>` child|
184+
|closed `<details>` element|Ignores view transition names inside the `<details>` element, as long as they are not part of the first `<summary>` child|
185185

186186
<style>{`
187-
#hiding-propertiestd td:nth-child(2) {
187+
#hiding-properties td:nth-child(2) {
188188
white-space: nowrap;
189189
}
190190
`}</style>
@@ -198,12 +198,12 @@ You can also use CSS properties to hide view transition names:
198198
|`display`|`contents`|Ignores view transition names of the element only, but not of its descendants|
199199
|`content-visibility`|`hidden`|Ignores view transition names of the subtree, excluding its root|
200200
|`view-transition-scope`|`all`|Hides view transition names of the subtree from the element's ancestors|
201-
|`visibility`|`hidden`|<span style="color: red;">Has no effect on hiding view-transition names</span>|
202-
|`visibility`|`collapse`|<span style="color: orange;">Hides names where it completely removes elements, but shows inconsistent behaviour between browsers</span>|
201+
|`visibility`|`hidden`|<span style="color: red;">Has no effect on hiding view transition names</span>|
202+
|`visibility`|`collapse`|<span style="color: orange;">Hides names where it completely removes elements, but shows inconsistent behaviour between browsers</span>|
203203
</div>
204204

205205

206-
Here, `view-transition-scope` is a relatively new CSS property that is currently supported only in Chrome. With value `all`, it hides the view transition names of its subtree without changing how the elements are rendered.
206+
Here, `view-transition-scope` is a relatively new CSS property that is currently supported only in Chrome. With the value `all`, it hides the view transition names of its subtree without changing how the elements are rendered.
207207
It hides the names from view transitions rooted at an ancestor of the scoped element, but not from a view transition rooted at the scoped element itself or its descendants.
208208

209209
With these mechanisms for hiding view transition names, you can use the same `view-transition-name` multiple times within the same DOM, provided that all but one instance are hidden.

0 commit comments

Comments
 (0)