W3C home > Mailing lists > Public > public-css-archive@w3.org > January 2017

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

From: Florian Rivoal via GitHub <sysbot+gh@w3.org>
Date: Sun, 08 Jan 2017 02:09:25 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-271124087-1483841363-sysbot+gh@w3.org>
@kojiishi I am not sure I understand what you mean. Do you mean you 
prefer to keep the spec as-is with only the `text-decoration-skip` 
shorthand, no `text-decoration-skip-*` longhands, or to change to add 
only the `text-decoration-skip-*` longhands, and remove the 
`text-decoration-skip` shorthand?

Well, there's two part to my suggestion.

1) add a `text-decoration-skip-*` as longhands of 
`text-decoration-skip`.

2) limit the shorthand to  only `none` and `auto`, requiring authors 
to use longhands for everything else

If we only want to do 1, we can do it any time we want (but I would 
still argue that the sooner the better). If we want to do 2 as well, 
we need to do it before it gets significant usage.

If you'd like to only add the longhands and remove the shorthand 
(possibly adding it back latter), we would need to do it now, but I am
 not sure what the benefit is compared to 1+2.

I think limiting the shorthand to resets only (`none` and `auto`), and
 using the longhands to toggle on and off the various aspects of 
skipping will lead to more robust and DRY code. This includes avoiding
 accidental overrides of whatever the browser's default value is, but 
also makes it easier to avoid fighting with yourself or your 
colleagues when you want different types of skipping to cascade 
separately.

For example, something like this is pretty painful to do without 
longhands:
```css
* { text-decoration-skip-ink: all }
:lang(ja,zh,ko) { text-decoration-skip-ink: none }
:lang(zh), a[href] { text-decoration-skip-edges: all; }
img { text-decoration-skip-objects: all; }
pre code { text-decoration-skip-spaces: leading trailing; }
```

If that's the preferred coding style (and I think it should be), 
having any other value than `none` and `auto` is mostly a footgun.

Also, while any change to the default behavior is a “breaking” one, 
regardless of syntax, some breakage may be minor and advantageous. For
 example, I am not sure we will do it, but it doesn't seem crazy to me
 that we would eventually decide that the initial value of 
text-decoration-skip-ink is neither on nor off, but some kind of 
script dependent auto. If we limit the shorthand to `auto` and `none` 
and require authors to use longhands instead, everyone who hasn't 
explicitely set ink skipping one way or another will benefit. If we 
require (because we didn't introduce longhands) or allow (because we 
introduce longhands, but leave the full syntax on the shorthand) 
authors to use the shorthand, effectively everyone who has used this 
property, including for changes unrelated to ink-skipping, will miss 
out.

-- 
GitHub Notification of comment by frivoal
Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/843#issuecomment-271124087 
using your GitHub account
Received on Sunday, 8 January 2017 02:09:37 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:07 UTC