additive-symbols CSS at-rule descriptor

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2023.

The additive-symbols descriptor of the @counter-style at-rule is used to specify counter symbols when the @counter-style system descriptor value is set as additive. The additive system is used to construct sign-value numbering systems such as Roman numerals.

Syntax

css
/* Single tuple */
additive-symbols: 3 "*";

/* Comma-separated list of tuples */
additive-symbols:
  3 "0",
  2 "\2E\20",
  1 url("symbol.png");

/* Binary counter */
additive-symbols:
  2 "1",
  1 "0";

/* Etruscan (a civilization in ancient Italy) counter  */
additive-symbols:
  100 "𐌟",
  50 "𐌣",
  10 "𐌢",
  5 "𐌡",
  1 "𐌠";

Values

The descriptor accepts a comma-separated list of additive tuples with each tuple consisting of the following two values separated by a space:

<integer>

A non-negative integer values specifying the integer weight of the associated symbol value of the tuple.

<symbol>

Specifies the counter symbol to be used for the weight value defined by the associated <integer> weight value of the tuple.

Note: The additive tuples must be specified in order of descending weight; otherwise, the descriptor declaration isn't valid and is ignored.

Description

The additive-symbols descriptor defines a comma-separated list of additive tuples. Each additive tuple contains a space-separated non-negative integer and counter symbol. To be valid, the list must be in the descending order of integer. The integer and symbol are concatenated together to form the counter symbol.

When the system descriptor value is cyclic, numeric, alphabetic, symbolic, or fixed, use the symbols() descriptor instead of additive-symbols.

Formal definition

Related at-rule@counter-style
Initial valuen/a (required)
Computed valueas specified

Formal syntax

additive-symbols = 
[ <integer [0,∞]> && <symbol> ]#

<integer> =
<number-token>

<symbol> =
<string> |
<image> |
<custom-ident>

<image> =
<url> |
<image()> |
<image-set()> |
<cross-fade()> |
<element()> |
<gradient>

<image()> =
image( <image-tags>? [ <image-src>? , <color>? ]! )

<image-set()> =
image-set( <image-set-option># )

<cross-fade()> =
cross-fade( <cf-image># )

<element()> =
element( <id-selector> )

<image-tags> =
ltr |
rtl

<image-src> =
<url> |
<string>

<image-set-option> =
[ <image> | <string> ] [ <resolution> || type( <string> ) ]?

<cf-image> =
[ <image> | <color> ] &&
<percentage [0,100]>?

<id-selector> =
<hash-token>

Examples

Specifying additive symbols

HTML

In this example, system: additive along with the additive-symbols descriptor values specify how numbers should be represented as Roman numerals. The value of each <li> element in the list is converted to a Roman numeral according to the rules defined in @counter-style.

html
<ul>
  <li>One</li>
  <li>Two</li>
  <li>Three</li>
  <li>Four</li>
  <li>Five</li>
  <li value="109">109</li>
  <li>110</li>
</ul>

CSS

css
@counter-style uppercase-roman {
  system: additive;
  additive-symbols:
    1000 M,
    900 CM,
    500 D,
    400 CD,
    100 C,
    90 XC,
    50 L,
    40 XL,
    10 X,
    9 IX,
    5 V,
    4 IV,
    1 I;
}

ul {
  list-style: uppercase-roman;
  padding-left: 5em;
}

Result

For the list item with the value of 109, the numeral C represents 100, and IX represents 9. This generates CIX counter for the list item 109. The next list item automatically gets a value of 110. The roman numeral CX is derived from C for 100 and X for 10.

Specifications

Specification
CSS Counter Styles Level 3
# counter-style-symbols

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
additive-symbols
Chrome – Full support
Chrome 91 (Release date: 2021-05-25)
footnote Full support
Edge – Full support
Edge 91 (Release date: 2021-05-27)
footnote Full support
Firefox – Full support
Firefox 33 (Release date: 2014-10-14)
footnote Full support
Opera – Full support
Opera 77 (Release date: 2021-06-09)
footnote Full support
Safari – Full support
Safari 17 (Release date: 2023-09-18)
footnote Full support
Chrome Android – Full support
Chrome Android 91 (Release date: 2021-05-25)
footnote Full support
Firefox for Android – Full support
Firefox for Android 33 (Release date: 2014-10-14)
footnote Full support
Opera Android – Full support
Opera Android 64 (Release date: 2021-05-25)
footnote Full support
Safari on iOS – Full support
Safari on iOS 17 (Release date: 2023-09-18)
footnote Full support
Samsung Internet – Full support
Samsung Internet 16 (Release date: 2021-11-25)
footnote Full support
WebView Android – Full support
WebView Android 91 (Release date: 2021-05-25)
footnote Full support
WebView on iOS – Full support
WebView on iOS 17 (Release date: 2023-09-18)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

See also