← Back to release summary

CSS Symbols()

Category
CSS
Type
Chromium catches up
Status
Proposed (Chrome Proposed)
Intent stage
None

Summary

The CSS symbols() function lets authors define a counter style inline instead of first declaring a named @counter-style at-rule. It builds an anonymous counter style from a list of string symbols plus an optional counting system (cyclic, numeric, alphabetic, symbolic, or fixed), and is accepted as the counter style in list-style-type, the list-style shorthand, and counter() / counters().

Motivation

Defining a custom list marker in CSS today requires authoring a named  @counter-style  rule and referencing it by name, which is needlessly verbose for one-off, anonymous markers. The symbols() function lets authors define the same counter style inline, without inventing or managing a global name. It works wherever a counter style is accepted, specifically in list-style-type and the counter()/counters() functions. Gecko has supported symbols() since 2015, but Blink and WebKit have not, so this addresses an important interoperability gap.

Standards & signals

Samples: https://developer.mozilla.org/en-US/docs/Web/CSS/symbols

Explainers: https://developer.mozilla.org/docs/Web/CSS/symbols

View on chromestatus.com