Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tabatkins opened this issue Jul 19, 2023 · 2 comments
Open

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

tabatkins opened this issue Jul 19, 2023 · 2 comments
Labels

Comments

@tabatkins
Copy link
Member

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.

@fantasai
Copy link
Collaborator

I think we can safely allow reordering the counter style and the integers.

@fantasai
Copy link
Collaborator

And yes, if you're incorporating counter-increment, incorporate counter-set also. Even if it's just as a reset-only property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants