@font-face support
See original GitHub issueFirst off, thanks for this great extension!
I’d find it to be super useful to have support for toggling @font-face
rules to test fallback fonts in the order of variable fonts → web fonts → system fonts.
Cheers
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
font-face - CSS: Cascading Style Sheets - MDN Web Docs
Chrome Edge
@font‑face Full support. Chrome1. Toggle history Full support...
OpenType CBDT and CBLC rendering Full support. Chrome66. Toggle history Full support...
OpenType COLRv0 rendering Full...
Read more >@font-face Web fonts | Can I use... Support tables for HTML5 ...
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web ... @font-face Web fonts....
Read more >How to use @font-face in CSS
The @font-face rule allows custom fonts to be loaded on a webpage. ... This browser support data is from Caniuse, which has more...
Read more >CSS @font-face Rule - W3Schools
The @font-face rule is supported in Edge, Chrome, Firefox, Safari, and Opera. The numbers in the table specifies the first browser version that...
Read more >How To Define Custom Fonts in CSS with @font-face and font ...
The font-display property will also help us manage how we load fonts for various users. Now unzip the downloaded contents to our ./fonts...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
After digging deeper into this and talking to others it looks like css-tricks is using JavaScript to load the fonts using the Font Loading API, which is why they continue to render despite removing all font related CSS rules.
It looks like the workaround for this is to use
document.fonts.clear()
, which should clear out everything. Working out when to call that method is the next piece in the puzzle.This looks like an edge case so, in the short term, I’m tempted to create a PR based on https://github.com/keithclark/css-feature-toggle-devtools-extension/issues/6#issuecomment-454378761 so
@font-face
toggling is possible in the majority of cases.I’ve done investigation work…
The extension is behaving as it should. When disabling @font-face support, the style element that sets the font name in CSS Tricks looks like this (note the
-disabled-
prefix on the@font-face
declaration):… and when you re-enable support, the same block looks like this:
If you use the Elements tab to rename that font to
Rubik2
, Chrome will continue to use the old name and the new one. Therefore, anything usingfont-family: Rubik
will still be rendered with a custom font, which I believe is a bug.Also, if you remove that entire
<style>
block, the font is still applied. Again, I think that’s a bug.My hunch is this is caused by
<link rel="preload">
but more investigation is required: