-
Notifications
You must be signed in to change notification settings - Fork 683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-lists-3] Setting the start value of a reversed list #4211
Comments
Some archaeology on this topic:
|
@fantasai Is there a reason you used I don't really see a use case for having this magic N value other than for the start value of a reversed list, so I'm reluctant to generalize it beyond that use case. I still think the best solution is to resolve this issue together with issue #4181 as a preshint mapping to |
@MatsPalmgren I think that was a typo. :) It would either have to be |
I came here because I tried to work on whatwg/html#4816 but figured it'd be ideal if CSS could be used for reverse lists as well, which means this issue and #4181 need to be fixed.
I like this suggestion the most, I think. It adds a useful capability to CSS and makes it possible for HTML to use only preshints to CSS properties for rendering list items. |
@zcorpan to be clear this preshint would be on the |
Yes. |
This relies on CSS introducing 'counter-reset: reversed(ident)', see w3c/csswg-drafts#4211 (comment)
FYI, I've updated whatwg/html#4816 to so that:
|
This allows HTML to define the rendering for `<ol reversed>` in terms of a presentational hint for `counter-reset: reversed(list-item)` or `<ol reversed start=X>` to `counter-reset: reversed(list-item) X+1`. See whatwg/html#4816 Fixes w3c#4181 Fixes w3c#4211
This allows HTML to define the rendering for `<ol reversed>` in terms of a presentational hint for `counter-reset: reversed(list-item)` or `<ol reversed start=X>` to `counter-reset: reversed(list-item) X+1`. See whatwg/html#4816 Fixes w3c#4181 Fixes w3c#4211
I've made an attempt to define |
Note: We currently have #4181 open on reversing the increment in reversed lists.
Currently, the suggestion for mapping HTML reversed list starts to CSS is that HTML injects a
counter-reset
declaration on the OL element as part of the attribute-to-CSS mapping of the HTML presentational hint cascade level. There is, however, some amount of magic: the UA has to calculate the start number and pass it to CSS as an<integer>
, e.g.counter-reset: list-item 4
for a 3-item reversed list.Doing some calculations to figure out the value to pass to CSS isn't particularly unusual: for example, HTML does some special parsing of colors before passing to
color
andbackground-color
, and it does some bidi calculations before passing todirection
.What is super magical is that these calculations are currently defined to be dependent on CSS styles, not just on the contents of the markup. See HTML spec. In particular, this case is very strange, as not only is the
display: none
element skipped, the descendant SPAN is counted (which I personally find very surprising):Some options going forward include:
counter-reset: list-item calc(N+1)
where N is magically calculated as defined currently—counting alldisplay: list-item
descendants, but skipping the contents of any ol/ul/dir/menu elements.counter-reset: list-item calc(N+1)
with some reduced amount of HTML+CSS co-dependence for the counting (assuming there's a definition of that that makes sense and is Web-compatible)?display: list-item
descendants while skipping the contents of any ol/ul/dir/menu elements. HTML maps to that syntax.The text was updated successfully, but these errors were encountered: