Skip to content

Commit 7c14597

Browse files
committed
[css-lists] Add issue about counter-value().
1 parent 70f42a8 commit 7c14597

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

css-lists/Overview.bs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,6 +1265,29 @@ Printing Counters: the ''counter()'' and ''counters()'' functions</h2>
12651265
</pre>
12661266
</div>
12671267

1268+
<div class=issue>
1269+
Counters are sometimes useful for things other than printing markers.
1270+
In general, they provide the ability to number elements in sequence,
1271+
which can be useful for other properties to reference.
1272+
For example, using 'order' to put an element between two other specific elements
1273+
currently requires you to explicitly put 'order' on every element before and/or after the desired insertion point.
1274+
If you can set the 'order' value of everything to a counter, tho,
1275+
you can more easily insert an element into an arbitrary spot between two others.
1276+
1277+
Other use-cases involve nested or sibling elements with transforms that are meant to be slightly different from each other.
1278+
Today you have to use a preprocessor to do this in a reasonable way,
1279+
but a counter would make it work well in "plain" CSS.
1280+
1281+
(You can built up successive values in the nested case today
1282+
by using <a>custom properties</a> and stacking up nested ''calc()''s,
1283+
but this is a *little bit* clumsy,
1284+
and doesn't work for siblings.)
1285+
1286+
Suggestion is to add a <css>counter-value(<<ident>>)</css> function,
1287+
which returns the value of the named counter as an integer,
1288+
rather than returning a string.
1289+
</div>
1290+
12681291

12691292

12701293
<h2 id='ua-stylesheet'>

0 commit comments

Comments
 (0)