Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-font-loading] document.fonts vs. self.fonts distinction is annoying; consider defining window.fonts #7178

Open
domenic opened this issue Mar 29, 2022 · 0 comments

Comments

@domenic
Copy link
Collaborator

domenic commented Mar 29, 2022

https://andreubotella.com/csswg-auto-build/css-font-loading-3/#font-face-source

It is annoying that if you want to write code that works in both a window or worker context, you have to do (self.fonts || document.fonts).load(...).

It would be better if you could do fonts.load(...).

I propose that window.fonts be added as an alias for document.fonts, and all the examples be updated to steer people toward fonts instead of document.fonts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants