From a80bc0bf9cff702fc5e07b9dc613edbb96b0630f Mon Sep 17 00:00:00 2001 From: Martin Trapp <94928215+martrapp@users.noreply.github.com> Date: Mon, 13 Jan 2025 10:46:20 +0100 Subject: [PATCH] custom-ident --- src/content/docs/basics/styling.mdx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/content/docs/basics/styling.mdx b/src/content/docs/basics/styling.mdx index 0479ce8..9f90f4b 100644 --- a/src/content/docs/basics/styling.mdx +++ b/src/content/docs/basics/styling.mdx @@ -34,7 +34,9 @@ If you want a DOM element to participate in view transitions with an individual main { view-transition-name: main; } ``` -It is not important to have much imagination when choosing names. They can be the same as the `id` of an element or name of a singleton tag like `body` or `footer`. +Do not quote the names. They are not strings but [custom-ident](https://developer.mozilla.org/de/docs/Web/CSS/custom-ident) values. Ensure proper escaping of special characters. The simplest, most portable approach is to just use upper and lower case letters from A to Z, digits from 0 to 9, an underscore `_` or a hyphen `-` character. But don't start the name with a digit. While all other characters with a code < 128 need to be escaped, codes > 127 like 😄 seem to work just fine in view transition names. + +It is not important to have much imagination when choosing names. They can be the similar to the `id` of an element or name of a unique tag like `body` or `footer`. At the start of the view transition, the **view transition names have to be unique** in the DOM. You can exempt an element from this uniqueness check by setting its (or one of its parent's) styling to `visibility: hidden` or `display: none`. For those elements, the browser won't generate pseudos. -- knotmirror 0.0.1