Re: [csswg-drafts] [css-lists-4][css-content-3] Add counter-style property to associate default counter style (#8997)

The CSS Working Group just discussed `[css-lists-4][css-content-3] Add counter-style property to associate default counter style`, and agreed to the following:

* `RESOLVED: add counter-style that associates default counter styles with each counter specified by counter-reset on the same element`
* `RESOLVED: counter-style property takes a list of counter style keywords, which are matched up to counter-reset using coordinated list logic`
* `RESOLVED: name tbd`
* `RESOLVED: Work on counter shorthand`
* `RESOLVED: All the counter things`

<details><summary>The full IRC log of that discussion</summary>
&lt;emilio> fantasai: when you define a counter there's no association with counter style, just number+scope<br>
&lt;emilio> ... for anything other than decimal you need to explicitly set it every time you use counter() functions<br>
&lt;emilio> ... that's a minor difficulty and it gets even worse with target-counter()<br>
&lt;emilio> ... when you want to do multi-level lists you can't use different styles<br>
&lt;emilio> ... proposal is a counter-style list, much like counter-reset<br>
&lt;emilio> ... that associate counters with a default style<br>
&lt;Rossen_> q?<br>
&lt;emilio> ... I think it's a reasonable way of solving the issue<br>
&lt;emilio> q+<br>
&lt;bramus> emilio: would target counter take the counter from the elemen tyou are styling or the target element?<br>
&lt;bramus> fantasai: from the style associated with the counter<br>
&lt;Rossen_> q?<br>
&lt;emilio> fantasai: if you use implied counters but don't use counter-reset then you can't associate a style<br>
&lt;bramus> emilio: seems fine<br>
&lt;ntim> q+<br>
&lt;oriol> q+<br>
&lt;emilio> fantasai: it only works when you specify counter-reset<br>
&lt;emilio> ack emilio<br>
&lt;Rossen_> ack ntim<br>
&lt;emilio> ntim: how does this interact with the second argument to counter()?<br>
&lt;emilio> TabAtkins: that wins. Right now if you don't specify a second argument you get decimal, we'd change that<br>
&lt;Rossen_> ack oriol<br>
&lt;emilio> oriol: You mention this could be like counter-reset list, which doesn't use commas and has been a problem<br>
&lt;emilio> TabAtkins:<br>
&lt;emilio> TabAtkins: +1 for commas<br>
&lt;emilio> fantasai: I'd prefer to use commas<br>
&lt;emilio> ... if we used commas everywhere else<br>
&lt;emilio> ... so I'd be ok with adding a shorthand or something that uses commas<br>
&lt;emilio> ... but it'd be weird to make this the only counter prop that doesn't<br>
&lt;Rossen_> q?<br>
&lt;emilio> fantasai: proposal is add counter-style that associates default counter styles with each counter specified by counter-reset on the same element<br>
&lt;TabAtkins> i mean i guess we could define you could use, like, `[]` around your value to do more than the specified things<br>
&lt;TabAtkins> anyway this is on my time-travel list<br>
&lt;emilio> RESOLVED: add counter-style that associates default counter styles with each counter specified by counter-reset on the same element<br>
&lt;TabAtkins> 1) kill hitler, 2) introduce utf-8 five years earlier so ucs-2 never gets created, 3) put commas in the counter-* properties<br>
&lt;SebastianZ> +1 on that. ;)<br>
&lt;emilio> fantasai: follow-up question: there are two ways of binding styles with the names<br>
&lt;emilio> ... right now counter-reset gets name and value<br>
&lt;emilio> ... we should counter-style either just get the values and use the positional matching<br>
&lt;emilio> ... or follow the same syntax as counter-reset<br>
&lt;emilio> q+<br>
&lt;emilio> ... and specify the name<br>
&lt;bramus> emilio: i think i have slight preference to use the positional one, otherwise it would feel like ???. my understanding is that it wouldnt<br>
&lt;bramus> … feels more confusing with the ?? and is slightly more inefficient<br>
&lt;dbaron> s/???/it would work without using counter-reset/<br>
&lt;bramus> … but that last thing is a minor thing<br>
&lt;TabAtkins> i should come up with a `counter` shorthand<br>
&lt;oriol> q+<br>
&lt;emilio> ack emilio<br>
&lt;TabAtkins> but +1 to emilio, don't have a strong opinion and that sounds fine<br>
&lt;Rossen_> ack emilio<br>
&lt;Rossen_> ack oriol<br>
&lt;emilio> oriol: I think we have the typical problem of what happens when you specify a list that's longers<br>
&lt;emilio> fantasai: we do the same as for background and animations etc<br>
&lt;emilio> ... so if you use counter-style: alphabetic and two counter resets then both are alphabetic<br>
&lt;bramus> emilio: so the shorter this behavior i think at some opoint some browsers clmaped the bg list and that is not great. it computes as a specified and then uses ???.<br>
&lt;bramus> fantasai: we should use the same rules<br>
&lt;Rossen_> ack dbaron<br>
&lt;emilio> dbaron: I think I agree with the conclusion about using the styles without the names and the list matching<br>
&lt;emilio> ... the issue I find with that solution is the name of the property<br>
&lt;emilio> ... counter-style doesn't feel like something that's talking about counters you are resetting<br>
&lt;emilio> fantasai: not concerned about it because we already have list-style and counter()<br>
&lt;oriol> q+<br>
&lt;emilio> dbaron: I think people are going to try using it on the element that's using the counter and get confused<br>
&lt;Rossen_> ack oriol<br>
&lt;emilio> oriol: Why are we tying this to counter-reset? Could we provide a way of specifying the associations separately?<br>
&lt;emilio> fantasai: you need to do it when the counter is created and counter-reset is what does that<br>
&lt;ntim> q+<br>
&lt;emilio> ... so it has to be tracked with the property that instantiate the counter<br>
&lt;emilio> q+<br>
&lt;emilio> ... counter-increment/set create implicit resets<br>
&lt;emilio> oriol: couldn't you provide a way to change the style separately from the counter<br>
&lt;emilio> fantasai: maybe I don't think that's useful?<br>
&lt;emilio> ... then we'd need to define the scoping etc<br>
&lt;emilio> oriol: other properties are not tied to reset<br>
&lt;emilio> fantasai: right because they change the value of the counter<br>
&lt;Rossen_> ack ntim<br>
&lt;emilio> ntim: Can we make this new property inherited?<br>
&lt;emilio> fantasai: no<br>
&lt;emilio> ... that doesn't give you good result<br>
&lt;emilio> TabAtkins: won't pair well, it also prevents shorthandifying counter styles<br>
&lt;emilio> fantasai: inheriting would cause wrong results if you only specify counter-reset somewhere down the tree<br>
&lt;emilio> q+<br>
&lt;Rossen_> q?<br>
&lt;Rossen_> ack emilio<br>
&lt;bramus> emilio: my other q is can we extend the counter-reset synbtax to allow this?<br>
&lt;bramus> TabAtkins: no, unless we want it to take a function<br>
&lt;miriam> q+<br>
&lt;bramus> … which can be space separted. but bc lack of commas we cant<br>
&lt;ntim> q+<br>
&lt;bramus> emilio: counter-reset takes item number/<br>
&lt;bramus> TabAtkins: ident optional number<br>
&lt;bramus> emilio: I guess you could maybe put the style with brackets but that sucks?<br>
&lt;bramus> TabAtkins: that is essentially a function<br>
&lt;bramus> … we should define a counter shorthand<br>
&lt;bramus> … and it will have commas<br>
&lt;ntim> q-<br>
&lt;bramus> fantasai: yes<br>
&lt;bramus> TabAtkins: we screwed up the counter-* props initially. dont knwo why<br>
&lt;emilio> dbaron: I think counter props might be the first list valued prop<br>
&lt;emilio> fantasai: font-family!<br>
&lt;emilio> miriam: I'm not totally convinced by arguments against tim's proposal<br>
&lt;emilio> ... I might want to to set the counters for the whole site<br>
&lt;Rossen_> ack miriam<br>
&lt;ntim> q+<br>
&lt;emilio> fantasai: then set it on * but otherwise inheriting gives you weird behavior for all the decimal-based counters that already work<br>
&lt;Rossen_> ack ntim<br>
&lt;emilio> ntim: my rationale was more something like list-style where you put list-style on the list-container<br>
&lt;emilio> TabAtkins: that's fair but list props are all inherited<br>
&lt;emilio> ... we're keeping those as consistent as possible<br>
&lt;bramus> emilio: you usually counter rest on the list container. so that would still work<br>
&lt;emilio> s/rest/reset<br>
&lt;emilio> fantasai: proposed resolution is a counter-style prop that takes a list of names<br>
&lt;bramus> emilio: regarding the name; counter-reset-style maybe?<br>
&lt;emilio> TabAtkins: fine with something like that<br>
&lt;emilio> ntim: can we resolve on working on the shorthand?<br>
&lt;emilio> TabAtkins: I'd be happy to resolve on that<br>
&lt;fantasai> PROPOSED: counter-style property takes a list of counter style keywords, which are matched up to counter-reset using coordinated list logic<br>
&lt;emilio> proposed: Add a property (counter-style/counter-reset-style/exact name tbd) that takes a list of counter-style names and gets associated to counter-reset using the coordinated property list behavior<br>
&lt;fantasai> RESOLVED: counter-style property takes a list of counter style keywords, which are matched up to counter-reset using coordinated list logic<br>
&lt;TabAtkins> RESOLVED: name tbd<br>
&lt;emilio> RESOLVED: Work on counter shorthand<br>
&lt;astearns> RESOLVED: All the counter things<br>
</details>


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


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

Received on Wednesday, 19 July 2023 18:17:22 UTC