Y
Hacker News
new
|
ask
|
show
|
jobs
by
matmo
3205 days 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?
2 comments
the8472
3205 days ago
Because 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-requiremen...
link
mihajlija
3205 days ago
what @the8472 said, here's some more context on the implementation details:
https://github.com/w3c/preload/issues/32
link
https://drafts.csswg.org/css-fonts/#font-fetching-requiremen...