Re: [csswg-drafts] [css-lists] Add `counter-increment: <counter-name> step(<integer>)` that negates integer in reversed lists (#6800)

The CSS Working Group just discussed ``[css-lists] Add `counter-increment: <counter-name> step(<integer>)` that negates integer in reversed lists``, and agreed to the following:

* `RESOLVED: Automatically negate the increment on reversed counters.`

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> oriol: We added a reversed() function to counter-reset etc.<br>
&lt;fantasai> oriol: It can be optionally followed with initial value of counter<br>
&lt;fantasai> oriol: But this reverse function only has an effect for the automatic list-item counter or when omitting this initial value<br>
&lt;fantasai> oriol: otherwise, authors using this, it's completely identical to using the counter name<br>
&lt;fantasai> oriol: This seems weird<br>
&lt;fantasai> oriol: I filed another issue to restrict it<br>
&lt;fantasai> oriol: Mats Palmgren had a suggestion for counter-increment to add a step(&lt;integer>) function<br>
&lt;fantasai> oriol: In non-reversed lists, it would be like incrementing the value<br>
&lt;fantasai> oriol: but in reversed lists it would be minus provided value<br>
&lt;fantasai> oriol: It would make these work, and also less magic<br>
&lt;fantasai> oriol: I would propose to add it<br>
&lt;fantasai> oriol: If people prefer to not add this<br>
&lt;fantasai> oriol: in that case I would suggest to restrict the syntax<br>
&lt;TabAtkins> q+<br>
&lt;astearns> ack kizu<br>
&lt;astearns> ack TabAtkins<br>
&lt;emilio> This is the magic fwiw: https://searchfox.org/firefox-main/rev/e959a4adbef21a366443993ab176f43461d38c28/layout/base/nsCounterManager.cpp#475-479<br>
&lt;fantasai> kizu: Why a new step function<br>
&lt;fantasai> s/kizu/TabAtkins/<br>
&lt;fantasai> TabAtkins: You said if you have a reversed list, if you counter increment of 1, do it as negative 1<br>
&lt;fantasai> TabAtkins: Why not implicitly reverse? Why have explicit step function?<br>
&lt;fantasai> oriol: Could be surprising if it's negated<br>
&lt;fantasai> oriol: But if ppl prefer to not add this, I would go back<br>
&lt;fantasai> oriol: I think it could be more useful<br>
&lt;fantasai> fantasai: When did we add reversed()?<br>
&lt;fantasai> oriol: While ago. It flags the counter as being reversed.<br>
&lt;ntim> to be able to describe &lt;ol reversed> through presentational hints<br>
&lt;fantasai> oriol: With this proposal, authors would provide an incremented that would be added or subtracted<br>
&lt;astearns> fantasai: this syntax is super-weird<br>
&lt;astearns> fantasai: agree with tab to just reverse without adding new syntax<br>
&lt;fantasai> oriol: ... concerned about compat but maybe it's fine?<br>
&lt;fantasai> oriol: Then we just automatically negate the increment.<br>
&lt;fantasai> PROPOSED: Automatically negate the increment on reversed counters.<br>
&lt;fantasai> oriol: Also avoid the ability to specify the initial value of the reversed counter.<br>
&lt;fantasai> fantasai: Why not allow it?<br>
&lt;fantasai> fantasai: you just start at a different value<br>
&lt;fantasai> oriol: list-item would become more magical<br>
&lt;fantasai> TabAtkins: You can combine start and reversed attributes and it counts down backwards<br>
&lt;fantasai> RESOLVED: Automatically negate the increment on reversed counters.<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6800#issuecomment-4173665433 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 2 April 2026 00:01:25 UTC