You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/basics/pseudos.mdx
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -172,19 +172,19 @@ There are two main cases where the View Transition API ignores view transition n
172
172
173
173
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.
174
174
175
-
### When Names are Ignored
175
+
### How to Hide Names
176
176
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.
178
178
179
179
On the HTML side, you can hide elements by adding the `hidden` attribute or by placing them inside a closed `<details>` element.
180
180
181
181
|HTML|Effect|
182
182
|-|-|
183
183
|`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|
185
185
186
186
<style>{`
187
-
#hiding-propertiestd td:nth-child(2) {
187
+
#hiding-properties td:nth-child(2) {
188
188
white-space: nowrap;
189
189
}
190
190
`}</style>
@@ -198,12 +198,12 @@ You can also use CSS properties to hide view transition names:
198
198
|`display`|`contents`|Ignores view transition names of the element only, but not of its descendants|
199
199
|`content-visibility`|`hidden`|Ignores view transition names of the subtree, excluding its root|
200
200
|`view-transition-scope`|`all`|Hides view transition names of the subtree from the element's ancestors|
201
-
|`visibility`|`hidden`|<spanstyle="color: red;">Has no effect on hiding view-transition names</span>|
202
-
|`visibility`|`collapse`|<spanstyle="color: orange;">Hides names where it completely removes elements, but shows inconsistent behaviour between browsers</span>|
201
+
|`visibility`|`hidden`|<spanstyle="color: red;">Has no effect on hiding viewtransition names</span>|
202
+
|`visibility`|`collapse`|<spanstyle="color: orange;">Hides names where it completely removes elements, but shows inconsistent behaviour between browsers</span>|
203
203
</div>
204
204
205
205
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.
207
207
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.
208
208
209
209
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