Skip to content

[css-lists] Design a 'counter' shorthand #9095

@tabatkins

Description

@tabatkins

In #8997 we resolved to add a 'counter' shorthand to let you set the counter-* styles together, since the grammar of counter-* properties makes them impossible to extend.

Here's my proposed syntax:

counter: <single-counter>#;
<single-counter> = <custom-ident> <integer>{0,2} <counter-style-name>?

The integers set the reset and the increment, in that order. If omitted they default to 0 and 1, same as the defaults in the longhands.

Questions:

  • do we want to bake counter-set into this at all? It, fundamentally, has nothing to do with creating a counter, it's only useful on a different element from what's creating the counter. I have a slightly different grammar proposal if we want to make that possible. I propose, tho, that we don't do so, and have this shorthand only reset -reset, -increment, and -style.

Explicitly pinging @nt1m since they pushed the resolution.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions