Skip to content

Commit bd5b6a6

Browse files
committed
[css-lists] Use calc() rather than increment hacks.
1 parent 1d80ab9 commit bd5b6a6

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

css-lists/Overview.bs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1305,8 +1305,7 @@ Sample style sheet for HTML</h2>
13051305

13061306
/* The start attribute on ol elements */
13071307
ol[start] {
1308-
counter-reset: list-item attr(start integer, 1);
1309-
counter-increment: list-item -1;
1308+
counter-reset: list-item calc(attr(start integer, 1) - 1);
13101309
}
13111310

13121311
/* The value attribute on li elements */
@@ -1317,9 +1316,8 @@ Sample style sheet for HTML</h2>
13171316

13181317
/* Handling reversed lists */
13191318
ol[reversed] {
1320-
counter-reset: list-item attr(start integer, **magic**);
1319+
counter-reset: list-item calc(attr(start integer, **magic**) + 1);
13211320
/* Where **magic** is the number of child &lt;li> elements. */
1322-
counter-increment: list-item -1;
13231321
}
13241322
ol[reversed] > li {
13251323
counter-increment: list-item -1;

css-lists/Overview.html

+2-4
Original file line numberDiff line numberDiff line change
@@ -1321,8 +1321,7 @@ <h2 class="heading settled heading" data-level=10 id=ua-stylesheet><span class=s
13211321

13221322
/* The start attribute on ol elements */
13231323
ol[start] {
1324-
counter-reset: list-item attr(start integer, 1);
1325-
counter-increment: list-item -1;
1324+
counter-reset: list-item calc(attr(start integer, 1) - 1);
13261325
}
13271326

13281327
/* The value attribute on li elements */
@@ -1333,9 +1332,8 @@ <h2 class="heading settled heading" data-level=10 id=ua-stylesheet><span class=s
13331332

13341333
/* Handling reversed lists */
13351334
ol[reversed] {
1336-
counter-reset: list-item attr(start integer, **magic**);
1335+
counter-reset: list-item calc(attr(start integer, **magic**) + 1);
13371336
/* Where **magic** is the number of child &lt;li&gt; elements. */
1338-
counter-increment: list-item -1;
13391337
}
13401338
ol[reversed] &gt; li {
13411339
counter-increment: list-item -1;

0 commit comments

Comments
 (0)