4 ms·
"One thing to pay attention to when preloading fonts is that you also have to set the crossorigin attribute even if the font is on the same domain: <link rel="p
by matmo 9y ago
"One thing to pay attention to when preloading fonts is that you also have to set the crossorigin attribute even if the font is on the same domain: <link rel="preload" href="font.woff" as="font" crossorigin>"
But why?
- the8472 9y agoBecause the spec says font-loads from stylesheets must always be anonymous CORS. Thus the preload needs to match that. https://drafts.csswg.org/css-fonts/#font-fetching-requirements https://drafts.csswg.org/css-fonts/#font-fetching-requiremen...
- mihajlija 9y agowhat @the8472 said, here's some more context on the implementation details: https://github.com/w3c/preload/issues/32 https://github.com/w3c/preload/issues/32