CSS <custom-ident> Data Type
The <custom-ident> data type is a name you choose, such as an animation, grid area or counter name. It is case-sensitive and not quoted.
Description
The <custom-ident> CSS data type represents a name chosen by the author, used as an identifier rather than as a keyword that CSS already knows. Whenever you give something your own name in a stylesheet, such as an animation, a counter, a grid line, a container or a view transition, that name is a <custom-ident>. Properties that accept it include animation-name, counter-reset, counter-increment, grid-area, container-name, list-style-type (for names defined with @counter-style) and view-transition-name.
A <custom-ident> follows the same rules as any CSS identifier. It can contain letters, digits, hyphens (-), underscores (_) and non-ASCII characters, but it must not start with a digit, and it must not start with a hyphen followed by a digit. Other characters, such as spaces or punctuation, can be included by escaping them with a backslash. Unlike most CSS keywords, a <custom-ident> is case-sensitive, so Slide and slide are two different names.
Some names are reserved and cannot be used. The CSS-wide keywords initial, inherit, unset, revert and revert-layer, as well as default, are never valid. Individual properties also exclude their own keywords; for example, none cannot be used as an animation name because animation-name: none already has a meaning.
Examples:
/* Naming an animation */
@keyframes slide-in {
from { transform: translateX(-100%); }
to { transform: translateX(0); }
}
.panel {
animation-name: slide-in;
}
/* Naming a counter */
article {
counter-reset: section;
}
h2::before {
counter-increment: section;
content: counter(section) ". ";
}
/* Naming a container for container queries */
.sidebar {
container-name: sidebar;
container-type: inline-size;
}
Names that start with two hyphens form a related type, <dashed-ident>, which is used for custom properties and other author-defined names.
Interactive Demo
Syntax
property: <custom-ident>;
Values
- <custom-ident>Any valid CSS identifier made of letters (a-z, A-Z), digits (0-9), hyphens, underscores, non-ASCII characters and escaped characters. It must not start with a digit, or with a hyphen followed by a digit. It is case-sensitive and cannot be one of the CSS-wide keywords (initial, inherit, unset, revert, revert-layer) or default.
Example
Browser Support
The following information will show you the current browser support for the CSS custom-ident data type. Hover over a browser icon to see the version that first introduced support for this CSS data type.
Desktop





Tablets & Mobile





