[csswg-drafts] [css-text-decor] selective toggling in the text-decoration-skip property.

frivoal has just created a new issue for 
https://github.com/w3c/csswg-drafts:

== [css-text-decor] selective toggling in the text-decoration-skip 
property. ==
Following up from 
https://github.com/w3c/csswg-drafts/issues/727#issuecomment-268952763,
 as that was a side track to the original issue.

---

Essentially, 
[`text-decoration-skip`](https://drafts.csswg.org/css-text-decor-4/#text-decoration-skip-property)
 is a list of independent toggles, but you cannot easily add or remove
 one while keeping whatever else would be there intact.

Say I want to add `leading-spaces` and `trailing-spaces` to the 
default behavior, and put this in my author stylesheet:

~~~
:root { text-decoration-skip: objects leading-spaces trailing-spaces; 
}
~~~

Bam, I've just accidentally killed safari's by-default ink-skipping 
that I wasn't even aware of.

Or say I go the other way around, and like safari's by-default 
ink-skipping and add it to my author stylesheet to do the same in 
other browsers. Now if/when browsers add leading-spaces and 
trailing-spaces to the default value, I miss out.

Similarly, say I want to remove object-skipping for a particular 
element, `<del>` for example. How do I do that if I don't want to 
affect whatever else was being skipped, whether it came from default 
values, UA styles, or some other style I wrote myself?

I think the only precedent we have for this is the font-variant 
property, which is also a list of switches. If we apply the same model
 to text-decoration-skip, we'd have something like this (verbosity and
 bikesheding aside):

longhands:
~~~
text-decoration-skip-objects: none | objects
text-decoration-skip-spaces: none | [leading-spaces || 
trailing-spaces] | spaces
text-decoration-skip-ink: none | ink
text-decoration-skip-edges: none | edges
text-decoration-skip-box-decoration: none | box-decoration
~~~

shorthand:
~~~
text-decoration-skip: none | auto |
                     [
                       objects ||
                       [ spaces | [ leading-spaces || trailing-spaces 
] ||
                       ink ||
                       edges ||
                       box-decoration
                     ]
~~~

`none` sets all longhands to `none`,  `auto` is the initial value, and
 sets longhands to something smart (`object ink leading-spaces 
trailing-spaces`?), and other values are passed to through to the 
corresponding longhands and set all others longhands to none.

Alternatively, since we have no compat baggage to worry about and we 
would want authors to use these longhands to avoid the traps I 
mentioned at the beginning, maybe the shorthand should only have 
`none` and `auto`.
Actually I think I'd prefer that. Here's a possible bikesheeding:

~~~
text-decoration-skip: none | auto

text-decoration-skip-objects: none | all
text-decoration-skip-spaces: none | [leading || trailing] | all
text-decoration-skip-ink: none | all
text-decoration-skip-edges: none | all
text-decoration-skip-box-decoration: none | all
~~~

I know that's a breaking change and the spec is already in CR, but if 
you all agree it's a good idea, I wouldn't feel bad about doing it 
given the lack of implementations.

PS: the `[leading || trailing]` part could only be in level 4, but the
 rest should go in level 3 if we want to do it at all.

Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/843 using your GitHub 
account

Received on Wednesday, 28 December 2016 16:23:08 UTC