What @counter-style unlocks
The CSS @counter-style at-rule defines a custom way of producing the markers in an ordered list. The built-in list-style-type values cover the common cases: decimal, lower-roman, upper-roman, lower-alpha. @counter-style adds everything else: Roman with extended ranges, Greek alphabets, hand-picked emoji sequences, or any arbitrary symbol set. Once defined, the custom style is used by setting list-style-type: my-style-name on the ol element.
Behind the scenes @counter-style maps integers to glyph sequences using a system descriptor. The systems are: cyclic (repeat the symbols), numeric (positional like decimal), alphabetic (positional like A B C with carry to AA AB), symbolic (each symbol used in turn then doubled), additive (Roman-style sum of symbol values), fixed (exact mapping per integer), and extends (inherit and override a built-in).
When you actually need this
Documentation sites with deeply nested lists outgrow the four built-in alphabets fast. Beyond level 4, the spec leaves you with arbitrary characters. @counter-style lets you set up a clean nesting like 1, a, i, 1.a.i with the levels visually distinct.
Brand-conscious editorial sites use custom symbol sets to match their voice. A wine review site might number tasting notes with grape emojis. A trail guide might use mountain symbols. A legal document might need section-mark prefixes (§ 1, § 2). All these are one @counter-style declaration.
Common Use Cases
Technical documentation uses @counter-style to render appendix-style numbering: Appendix A, Appendix B, then sub-items A.1, A.2. Recipe sites use it to set ingredient lists apart from cooking steps with different marker styles. Style guides use it to enforce one numbering pattern across every authored page.
Accessibility-focused teams use @counter-style with caution because not all screen readers announce custom markers. The speak-as descriptor can ask screen readers to announce the number instead, but MDN lists it as unsupported in Safari, so test with the screen readers your audience uses.
Worked example: what each preset renders
On October 12, 2026 we rendered every preset in Chromium and read each marker back from the browser's accessibility tree, which holds the text the browser actually drew:
| Preset | List number | Marker drawn by Chromium |
|---|---|---|
| roman-upper (additive) | 1, 4, 9, 1994 | I, IV, IX, MCMXCIV |
| roman-lower | 1994 | mcmxciv |
| greek-alpha (alphabetic) | 1, 24, 25, 1994 | α, ω, αα, γλβ |
| circled (fixed) | 10, 11 | ⑩, then 11 from the decimal fallback |
| emoji-stars (cyclic) | 1 to 6 | ⭐ 🌟 ✨ ⭐ 🌟 ✨ |
| binary (numeric) | 9, 1994 | 1001, 11111001010 |
- Additive systems need additive-symbols. Pairs of weight and symbol, separated by commas, largest weight first. Until October 12, 2026 the default Roman preset wrote them under symbols, which made the whole rule invalid, and had no subtractive pairs (it would have drawn IIII). The tool now writes additive-symbols and checks the weights are in descending order.
- Everything is editable. Pick a system, type your own symbols (quote one to include spaces, such as "Part A"), set a range, prefix and suffix. Quotes and backslashes in the prefix and suffix are escaped for you, and names CSS reserves, such as decimal or none, are refused.
- The preview is the browser's verdict. The page reads back how your browser parsed the rule; if a descriptor was dropped it says so, because the list would quietly fall back to decimal. Every output also includes fallback: decimal for numbers outside the range.
- Built-ins first. For ordinary Roman numerals and Greek letters, list-style-type: upper-roman and lower-greek are predefined; a custom style is worth it when you need different symbols, a prefix or suffix, or a range.
Sources
Checked on .