-
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-text-decor] How to use decoration skipping to turn off underlines? #2885
Comments
Looks like it used to offer that facility, but it was removed: https://www.w3.org/TR/2010/WD-css3-text-20101005/#text-decoration-skip |
The easy way to fix this would be to add back an We'd need to do this using a property that doesn't inherit. |
OK, here's my proposal:
where
Questions:
Thoughts? |
The CSS Working Group just discussed
The full IRC log of that discussion<TabAtkins> Topic: using decoration-skipping to turn off underlines<TabAtkins> github: https://github.com//issues/2885 <TabAtkins> fantasai: We've had a variety of suggestions for how to turn off ancestor underlines on an element <TabAtkins> fantasai: We had a suggestion of using text-decoration-skip; it didn't work since it was inheriting <TabAtkins> fantasai: that doesn't work <TabAtkins> fantasai: My suggestion is to add text-decoration-skip-self: auto | skip | no-skip <TabAtkins> fantasai: could add no-skip later if needed <TabAtkins> fantasai: non-inherited property <TabAtkins> fantasai: auto skips if it's atomic inline <TabAtkins> fantasai: skip skips the element regardless <TabAtkins> fantasai: no-skip avoids skipping even if it's atomic inline; draw it over/under as if it's a character <TabAtkins> fantasai: useful when images are used as text, like in CJK for rare characters <TabAtkins> fantasai: not ideal but it happens <TabAtkins> fantasai: skip would apply to inlines; all ancestor decorations would skip, but its own text decorations would apply <emilio> q+ <TabAtkins> astearns: This is in addition to the skipping we already have? <TabAtkins> fantasai: this replaces the existing text-decoration-skip:self <TabAtkins> fantasai: independent from ink skipping <TabAtkins> emilio: Is the auto beahvior how browsers behave today? <TabAtkins> fantasai: yes <TabAtkins> emilio: sounds reasonable <astearns> ack emilio <TabAtkins> astearns: how does it interact with text-decoration-skip? <TabAtkins> astearns: assume not a shorthand relationship <TabAtkins> fantasai: We've discussed having a shorthand for both inherited and non <TabAtkins> fantasai: several places in TExt where it might be useful <TabAtkins> fantasai: but haven't pulled the trigger yet <TabAtkins> fantasai: for here it's less critical, but i think it's useful for text-decoration-skip to be a shorthand <TabAtkins> fantasai: there was also some white space property where we thought about mixing inherited and non <TabAtkins> emilio: Don't we already ahve one mixed? <TabAtkins> emilio: border-color? i guess that doesn't inherit <TabAtkins> fantasai: I think we ahd a proposal for one, but we never solidified it <TabAtkins> florian: there was something but we changed it to have a special value that mimics non-inheritance <astearns> s/florian/fremy/ <TabAtkins> fantasai: my suggestion is we make text-decoration-skip a shorthand for all the skip props <TabAtkins> fantasai: we might need to make the keywords more unique, then <TabAtkins> jfkthame: do you want to control skipping separately for the different decorations? <TabAtkins> jfkthame: Like skip underlines on sub elements, but not overlines <TabAtkins> fantasai: yeah <TabAtkins> +1 <TabAtkins> astearns: If an author wanted it, would they be able to skip everything and reset the others? <TabAtkins> jfkthame: No, if you reset on the child they'll move to match the child rather than being continuous <TabAtkins> emilio: the 'all' trivially does inherited and non-inherited <TabAtkins> TabAtkins: lol yeah but it's a special case <dbaron> At least the old Gecko style system (and maybe other engines) had optimizations (in the rule tree) that benefited from shorthands (for many common shorthands) being all-inherited or all-non-inherited. <TabAtkins> fantasai: so maybe we want skip-all, skip-underline, etc <TabAtkins> astearns: maybe we could add the specific values when we have use-cases? jonathan, do you know it's something we want to do right now? <TabAtkins> jfkthame: No haven't been hearing much demand, just seemed like a natural request <TabAtkins> fantasai: It's good to bring up, as it can affect our naming <TabAtkins> astearns: maybe goes back to Myles since he brought it up, to see if it's something he wants to design <dbaron> (Are there people who want text-decoration-skip-ink to apply to line-through decorations?) <TabAtkins> fantasai: I think we're resolved to add a non-inherited property (a longhand of t-d-skip) that skips t-ds imposed by an ancestor <TabAtkins> fantasai: open questio is whether we add keywords for the specific types of decorations <TabAtkins> dbaron: wondering about separate decorations... <TabAtkins> dbaron: we had people asking for skipping for strike-thrus <fantasai> s/we had/have we had/ <TabAtkins> fantasai: currently we ink-skip on under and overlines, not linethrus, since it should look like you're striking the text <fantasai> fantasai: I haven't heard sucha request <fantasai> ^ <TabAtkins> astearns: OPinions or concerns? <TabAtkins> astearns: so proposed resolution is to add the new prop as a longhand of t-d-skip <TabAtkins> astearns: objections? <TabAtkins> RESOLVED: Add text-decoration-skip-self as a longhand of text-decoration-skip, for skipping ancestor decorations. |
Suggestion from @jfkthame was that the author might want to control the different types of line decorations independently, so we'd have values like Another consideration was to make sure the keyword names are unique so that they can be properly combined into the |
@jfkthame @litherum I've added the new |
Seems this could allow combinations:
|
@Loirooriol Good catch. Fixed, lmk if the computation edits seem appropriate. |
Does this mean they belong (or may belong if the UA chooses so) to a text decoration category different than underline, overline and line-through? Then they aren't skipped by |
It’s a little spooky to create a property for every value of another property. Is this really the right design? What happens when the other property gets a complicated grammar? |
I am not sure if the intent is to keep or remove It could be treated as an alias of |
https://drafts.csswg.org/css-text-decor-4/#propdef-text-decoration-skip
During the Sydney F2F, there was an assertion that the
text-decoration-skip-*
properties can be used to turn off underlining on a particular element. However, I don’t see any value totext-decoration-skip
that seems relevant. (The spec hasn’t been updated to break out each of these values into their own properties)none
skips nothing, which is the opposite of what I wantobjects
only skips atomic inlines, but I want to turn off the underline on arbitrary contentspaces
,leading-spaces
, andtrailing-spaces
only skips whitespace, but I want it to skip arbitrary text contentedges
only insets the underline slightly, rather than skipping over entire elementsbox-decoration
also isn’t what I wantThe text was updated successfully, but these errors were encountered: