Favorites

CSS <dashed-ident> Data Type

<dashed-ident>
CSS Data TypeThis data type is supported by all modern browsers.
Updated 21st November 2026

The <dashed-ident> data type is a name you choose that starts with two dashes, such as --brand. It is used for custom properties and other author names.

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee

Description

The <dashed-ident> CSS data type represents an author-defined name that begins with two hyphens (--). It is a special form of <custom-ident> that CSS reserves for authors: the language will never define its own keywords starting with --, so these names can never clash with current or future CSS features. The best-known use is naming custom properties (CSS variables), such as --brand-color, which are then read with the var() function.

Beyond custom properties, <dashed-ident> is used wherever CSS needs a name that is guaranteed not to collide with keywords. Examples include the name of an @property rule, anchor-name and position-anchor for anchor positioning, scroll-timeline-name and view-timeline-name for scroll-driven animations, and the name given to an @font-palette-values rule.

Like other identifiers, a <dashed-ident> is case-sensitive, so --Accent and --accent are different names. After the two leading hyphens it can contain letters, digits, hyphens, underscores, non-ASCII characters and escaped characters. The name -- on its own is reserved and should not be used.

Examples:

/* Custom properties */
:root {
  --brand-color: #0b69ff;
  --radius: 12px;
}

.button {
  background: var(--brand-color);
  border-radius: var(--radius);
}

/* A registered, typed custom property */
@property --progress {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 0%;
}

/* Anchor positioning */
.trigger {
  anchor-name: --menu-button;
}

.menu {
  position: absolute;
  position-anchor: --menu-button;
}

Because every <dashed-ident> lives in the author's namespace, it is a safe choice for design tokens, theme variables and any other names shared across a stylesheet.

Interactive Demo

Themed card

Demo Code
HTML Code
<div class="demo-element">
	<h4>Themed card</h4>
	<button type="button">Button</button>
</div>
CSS Code
.demo-element h4 {
	margin: 0 0 8px;
	font-size: 16px;
}
.demo-element button {
	padding: 6px 14px;
	border: 0;
	border-radius: 4px;
	background: var(--accent);
	color: #fff;
	font-size: 14px;
}
.demo-element {
	width: 240px;
	padding: 14px;
	border: 3px solid var(--accent);
	border-radius: 8px;
	background: color-mix(in srgb, var(--accent) 12%, white);
	color: var(--accent);
	--accent: #4361ee;
}

Syntax

property: <dashed-ident>;

Values

  • <dashed-ident>An identifier that starts with two hyphens (--), followed by letters, digits, hyphens, underscores, non-ASCII characters or escaped characters. It is case-sensitive, and the name -- on its own is reserved.

Example

<div class="wrap">
<h1>CSS &lt;dashed-ident&gt; example</h1>
<div class="themes">
<div class="card">
<h2>Blue</h2>
<code>--accent: #0b69ff;</code><br>
<button>Button</button>
</div>
<div class="card green">
<h2>Green</h2>
<code>--accent: #16a34a;</code><br>
<button>Button</button>
</div>
<div class="card orange">
<h2>Orange</h2>
<code>--accent: #ea580c;</code><br>
<button>Button</button>
</div>
</div>
</div>
/* Demonstrates  names used as custom properties */
:root {
  --surface: #ffffff;
  --text: #0f172a;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 24px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  background: #eef2f7;
  color: var(--text);
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
}

h1 {
  font-size: 20px;
  margin: 0 0 16px;
}

.themes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.card {
  /* each theme only changes the --accent dashed-ident */
  --accent: #0b69ff;
  background: var(--surface);
  border-radius: var(--radius);
  border-top: 6px solid var(--accent);
  padding: 18px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.card.green { --accent: #16a34a; }
.card.orange { --accent: #ea580c; }

.card h2 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--accent);
}

.card code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 12px;
}

.card button {
  margin-top: 12px;
  border: 0;
  border-radius: calc(var(--radius) / 2);
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
Open in editor

Browser Support

The following information will show you the current browser support for the CSS dashed-ident data type. Hover over a browser icon to see the version that first introduced support for this CSS data type.

This data type is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee