Re: [csswg-drafts] [css-lists] Initial value of counter-increment needs to be something different from none (#3686)

@heycam That was my understanding, yes. If you use `value` and `counter-increment` together, you need to specify `listitem 0` to disable the auto-incrementing in your `counter-increment` based on the currently approved proposal, otherwise you would still get an automatic increment on top of what `value` specified. That wasn't the case in proposal C which took into account the presence of `listitem` in any of `counter-set` or `counter-increment` but the group went with proposal A instead as it appears simpler to implement.

Now of course your proposal makes a lot of sense, and we could have a special css property that would be `listitem-counter-increment: <number>` which defaults to 1 but is also being set with things like `reversed` and `value`; that would indeed mean `value` would set this rather than rely on authors not providing their own `counter-increment` at the same time as using the `value` attribute. I'm find this proposal really attractive.

```css
ul {
    listitem-counter-increment: 1;
}
ul[reversed] {
    listitem-counter-increment: -1;
}
li[value] {
    counter-set: listitem attr(value as integer);
    listitem-counter-increment: 0;
}
```

Going further, we could make all UA actions on the listitem counter be based on a special propoperty, and have `listitem-counter-set` which would set the listitem counter except if listitem is mentioned in `counter-set` by the author, similar to your proposal for `counter-increment` but being applied to `counter-set` instead. That might be overkill given how rare I would expect that second case to be, but consistency is nice.

-- 
GitHub Notification of comment by FremyCompany
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3686#issuecomment-479432491 using your GitHub account

Received on Wednesday, 3 April 2019 10:29:51 UTC