CSS text-decoration-skip
2 minutes 20 seconds average read (468 words)Looking at twitter this morning I saw a tweet by Monica Dinculescu:
Whatttttt how did I miss that `text-decoration-skip: ink` works in Chrome now? 🎉 Monica Dinculescu
Is this right?
Reading further down this twitter thread:
🚨 Oh no, I've led you to dragons.
Previous tweet was a bit wrong. So:
- text-decoration-skip: ink is deprecated
- text-decoration-skip-ink is the new thing, and works in Beta/Stable
(🙌 to @ebidel for sherlocking this with me) Monica Dinculescu
It appears that this has been deprecated.
So I also looked into this
Can I Use
Can I use does not, yet, have an entry for text-decoration-skip-ink
1 but does have an entry for text-decoration-skip
2.
It states that text-decoration-skip:ink;
and text-decoration-skip:object;
works in Chrome 61+ and Chrome for Android 62.
MDN (Mozilla Developer Network)
MDN has an entry for both text-decoration-skip-ink
and text-decoration-skip
.
text-decoration-skip-ink3
This has two values available:
text-decoration-skip-ink: none;
- no effecttext-decoration-skip-ink: auto;
- the underline will skip any characters that break the underline
Example
Support4
MDN says this is currently supports (as of 04/01/2018):
- Desktop
- Chrome 64
- Opera 50
- Mobile
- Android webview 64
- Chrome for Android 64
- Opera for Android 50
text-decoration-skip5
This has seven values available, ink
not being one:
none
- Nothing is skipped, i.e. text decoration is drawn for all text content and across atomic inline-level boxes.objects
- The entire margin box of the element is skipped if it is an atomic inline such as an image or inline-block.spaces
- All spacing is skipped, i.e. all Unicode white space characters and all word separators, plus any adjacentletter-spacing
orword-spacing
.leading-spaces
- The same asspaces
, except that only leading spaces are skipped.trailing-spaces
- The same asspaces
, except that only trailing spaces are skipped.edges
- The start and end of the text decoration is placed slightly inward (e.g. by half of the line thickness) from the content edge of the decorating box. E.g. two underlined elements side-by-side do not appear to have a single underline. (This is important in Chinese, where underlining is a form of punctuation.)box-decoration
- The text decoration is skipped over the box's margin, border and padding areas. This only has an effect on decorations imposed by an ancestor; a decorating box never draws over its own box decoration.
Support6
MDN says this is currently supports (as of 04/01/2018):
- Desktop
- Chrome 57
- Opera 44
- Safari 8 with
webkit-
prefix
- Mobile
- Android webview 57
- Chrome for Android 57
- Opera for Android 44
- Safari 8 with
webkit-
prefix
Footnotes
1 Can I Use text-decoration-skip-ink
2 Can I Use text-decoration-skip
3 MDN text-decoration-skip-ink