Re: [csswg-drafts] [css-pseudo] Problems with styling ::first-letter with punctuation (#2040)

I like the proposal for a child pseudo-element. I'm not sure of the status of nested pseudo-elements being legal, but it's a bridge we need to cross at some point anyway (if we haven't already), so let's not let that stop it.

1) I suggest that it be called simply `::punctuation`, the `first-` is redundant if it's a child of `::first-letter`. Also if we ever extend the notion to other pseudos like `::marker` we can simply re-use it rather than have `::marker-punctuation`.
2) There are examples of punctuation following the first letter being included in a drop cap, e.g. `L'` in French. I presume in that case punctuation following the first letter would also be a `::punctuation` pseudo-element. Which then allows two of them within a single `::first-letter`, e.g. `«L'`. In principle we could allow selecting them independently with pseudo-classes (once we allow pseudo-classes on pseudo-elements). I'm also guessing the rules about which following punctuation are to be included are likely language specific.
3) If there are multiple leading punctuation characters, would they all be considered one pseudo-element, individual pseudo-elements, or do we possibly need grouping rules, e.g. does `–«L'` have two or three `::punctuation`s? What if there's a space between the dash and quote? e.g. `– «L'`  This isn't relevant unless we can select the individual pseudo-elements with pseudo-classes, but I'm wondering if there's a use case to style them independently (I can see use cases for styling the leading and trailing punctuation differently, e.g. make the leading quote small, but the following apostrophe match the font size of the first-letter.)

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

Received on Thursday, 16 July 2020 06:01:45 UTC