Re: [csswg-drafts] [css-pseudo] Which properties to reset in ::marker (#4568)

> so even properties that don't apply will need to be reset if they're inheritable

So... I think this is an argument for clearly defining which properties apply to raw text vs to boxes vs to line boxes or their interaction with text, and clarifying that you can set declarations on ::marker and they will inherit to the text it contains. (Applying a property to a box vs letting it inherit through and affect its contents are slightly different concepts.)

I have no problem with allowing properties that affect text and not boxes to be applied to ::marker and to inherit through, since that wouldn't change behavior as we further develop a layout model for marker boxes.

I am concerned about things like `text-align` and `text-indent` since they reference the edges of the line box, and therefore their behavior could change as we define the layout model for marker boxes. From my perspective, setting `text-align: end !important; text-indent: 0 !important; hanging-punctuation: none !important` in the UA style sheet would be appropriate at this point in time (and at the point where layout is clearly defined, we can drop the `!important`.).

For the rest, I would let `text-shadow` inherit from the list item element the same as `color`. I suspect it's better to block inheritance of `text-transform` by default via `text-transform: none`, since casing is often used to distinguish list items. Wrt resetting `word-spacing` and `letter-spacing` I'm unsure. We have to remember that this resetting would be applied to inside markers as well as outside ones, and for inside markers in particular might make sense to inherit the paragraph's conventions.

So I guess my proposal would be:
* Allow properties that style text directly to ::marker, i.e. add `word-spacing`, `letter-spacing`, `text-shadow`, and maybe `text-emphasis` (if UAs want to implement it) alongside the font properties.
* Add `text-align: end !important; text-indent: 0 !important; hanging-punctuation: none !important` to the UA style sheet of any browser that supports those properties on ::marker.
* Add `text-transform: none` to the UA rule for ::marker.
* Don't add `word-spacing` or `letter-spacing` resets to the UA rule for ::marker.

I'm not entirely sure about the last two. @dauwhe ?


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

Received on Friday, 6 December 2019 20:57:22 UTC