Remove font-family -webkit-<generic-name>
- Category
- CSS
- Type
- Feature removal
- Status
- In development (Chrome In development)
- Intent stage
- Prepare to ship
WPT details: https://w3c-test.org/css/cssom/font-family-serialization-001.html https://w3c-test.org/css/css-fonts/generic-family-keywords-001.html https://w3c-test.org/css/css-fonts/generic-family-keywords-002.html
Summary
Remove support for the font-family values -webkit-cursive, -webkit-fantasy, -webkit-monospace, -webkit-sans-serif and -webkit-serif. They essentially behave as an alias to the standard keywords cursive, fantasy, monospace, sans-serif and serif and are only exposed as historical implementation details inherited from WebKit.
Motivation
Blink stores font-family's <generic-name> strings with a -webkit prefix for internal manipulation and removes that prefix when the font-family string is serialized. It is possible for users to directly use these -webkit prefixed forms as font-family's <family-name> values and hence observe special behavior for both rendering and serialization. Removing special behavior for these non-standard -webkit-<generic-name> values will improve alignment with the CSS specifications and Firefox. It will also make Blink's behavior more consistent e.g. that behavior does not happen for the generic font family "system-ui". It will also allow to greatly simplify our internal implementation of font-family, preparing for more cleanup and implementation of new generic names.
Standards & signals
- Specification: https://drafts.csswg.org/css-fonts-4/#font-family-prop
- Firefox: Shipped/Shipping — Firefox does not support these -webkit prefixed values.
- Safari: Neutral — As a general rule, Apple is against removing features if that can break things on the web or their platform. Myles C. Maxfield commented that he is aware of the issue and don't think it's something desirable that these values are web-exposed.
- Web developers: No signals — It's not clear whether developers are actually aware of this behavior but it was used by a few pages (see compat analysis).
- Tracking bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1065468
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=remove-font-family-webkit-generic-name
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+Remove%20font-family%20-webkit-%3Cgeneric-name%3E
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=Remove%20font-family%20-webkit-%3Cgeneric-name%3E
- Baseline status: https://webstatus.dev/?q=Remove%20font-family%20-webkit-%3Cgeneric-name%3E