Re: [csswg-drafts] [css-lists] canonical property order of list-style.

(@emilio , thanks for the cross-reference, somehow I missed this issue when I opened #2724)

The example I filed in the other issue I think is worth reproducing here for clarity
```
@counter-style inside {
...
}
@counter-style outside {
...
}
ul { list-style: inside outside } /* ambiguous */
ol { list-style: inside none } /* ambiguous */
```
I'd be against reordering of the list-style shorthand as a solution.

It's currently defined as `<list-style-type> || <list-style-position> || <list-style-image>`, which allows free reordering of the terms.

If you want to change it to remove the ambiguity introduced by allowing `list-style-type` to match "inside" or "outside", you're still going to have to allow any order **except** when the type is called "inside" or "outside". So "list-style: decimal inside" will remain valid, but "list-style: outside inside" where the counter is called "outside" is not.

First, the grammar is going to more complicated then necessary; something like `[<list-style-style-type-except-inside-outside> || <list-style-position> || <list-style-image>] | [<list-style-position || <list-style-image>] [inside | outside]?`, and that's discounting the special handling that will be required to interpret "none" correctly.

Second, even with an unambiguous grammar it will remain confusing. An author seeing "list-style: inside outside" will have no idea what is going on without consulting the spec.

Given so few browsers implement @counter-style at this stage, personally I feel the best solution is disallowing "inside" and "outside" as counter names. We already do it with "none" so there's precedent. Prevent authors from shooting themselves in the foot.

The second best solution would be not allowing them to be referenced from the list-style shorthand property. As pointed out above, there is no ambiguity except in the `list-style` shorthand property.
 

-- 
GitHub Notification of comment by faceless2
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2624#issuecomment-393515748 using your GitHub account

Received on Thursday, 31 May 2018 12:35:59 UTC