-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Move webfonts handling to internal only (not accessible) - WP 6.0 Stopgap #40472
Closed
7 tasks done
Labels
[Priority] High
Used to indicate top priority items that need quick attention
Comments
hellofromtonya
added
the
[Priority] High
Used to indicate top priority items that need quick attention
label
Apr 20, 2022
Current status: PR #40493 is ready for review and testing. |
Status Update:
|
pento
pushed a commit
to WordPress/wordpress-develop
that referenced
this issue
Apr 26, 2022
Adds `_wp_theme_json_webfonts_handler()` for handling `fontFace` declarations in a theme's `theme.json` file to generate the `@font-face` styles for both the editor and front-end. Design notes: * It is not a public API, but rather an internal, Core-only handler. * It is a stopgap implementation that will be replaced when the public Webfonts API is introduced in Core. * The code design is intentional, albeit funky, with the purpose of avoiding backwards-compatibility issues when the public Webfonts API is introduced in Core. * It hides the inter-workings. * Does not exposing API ins and outs for external consumption. * Only works for `theme.json`. * Does not provide registration or enqueuing access for plugins. For more context on the decision to include this stopgap and the Webfonts API, see: * Core's PR 40493 WordPress/gutenberg#40493 * Gutenberg's tracking issue 40472 WordPress/gutenberg#40472 Props aristath, hellofromTonya, peterwilsoncc, costdev, jffng, zieladam, gziolo, bph, jonoaldersonwp, desrosj. See #55567, #46370. git-svn-id: https://develop.svn.wordpress.org/trunk@53282 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith
pushed a commit
to markjaquith/WordPress
that referenced
this issue
Apr 26, 2022
Adds `_wp_theme_json_webfonts_handler()` for handling `fontFace` declarations in a theme's `theme.json` file to generate the `@font-face` styles for both the editor and front-end. Design notes: * It is not a public API, but rather an internal, Core-only handler. * It is a stopgap implementation that will be replaced when the public Webfonts API is introduced in Core. * The code design is intentional, albeit funky, with the purpose of avoiding backwards-compatibility issues when the public Webfonts API is introduced in Core. * It hides the inter-workings. * Does not exposing API ins and outs for external consumption. * Only works for `theme.json`. * Does not provide registration or enqueuing access for plugins. For more context on the decision to include this stopgap and the Webfonts API, see: * Core's PR 40493 WordPress/gutenberg#40493 * Gutenberg's tracking issue 40472 WordPress/gutenberg#40472 Props aristath, hellofromTonya, peterwilsoncc, costdev, jffng, zieladam, gziolo, bph, jonoaldersonwp, desrosj. See #55567, #46370. Built from https://develop.svn.wordpress.org/trunk@53282 git-svn-id: http://core.svn.wordpress.org/trunk@52871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
gMagicScott
pushed a commit
to gMagicScott/core.wordpress-mirror
that referenced
this issue
Apr 26, 2022
Adds `_wp_theme_json_webfonts_handler()` for handling `fontFace` declarations in a theme's `theme.json` file to generate the `@font-face` styles for both the editor and front-end. Design notes: * It is not a public API, but rather an internal, Core-only handler. * It is a stopgap implementation that will be replaced when the public Webfonts API is introduced in Core. * The code design is intentional, albeit funky, with the purpose of avoiding backwards-compatibility issues when the public Webfonts API is introduced in Core. * It hides the inter-workings. * Does not exposing API ins and outs for external consumption. * Only works for `theme.json`. * Does not provide registration or enqueuing access for plugins. For more context on the decision to include this stopgap and the Webfonts API, see: * Core's PR 40493 WordPress/gutenberg#40493 * Gutenberg's tracking issue 40472 WordPress/gutenberg#40472 Props aristath, hellofromTonya, peterwilsoncc, costdev, jffng, zieladam, gziolo, bph, jonoaldersonwp, desrosj. See #55567, #46370. Built from https://develop.svn.wordpress.org/trunk@53282 git-svn-id: https://core.svn.wordpress.org/trunk@52871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Update: The stopgap implementation has been committed into WordPress Core's All tasks are completed. Closing this issue. Thank you everyone for contributing! |
This was referenced Apr 27, 2022
Follow-up: Trac 58454 proposes to include |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What problem does this address?
Part of WordPress 6.0 is style variations to empower themers to define webfonts in their
theme.json
. Twenty Twenty-Two (TT2) introduces different styling options within itstheme.json
. Within this scope,theme.json
defines its webfonts and needs mechanisms to (a) expose the fonts to the typography pickers for user customizations and (b) generate the@font-face
declarations.However, the current Webfonts API is still in development and not ready for inclusion in WordPress 6.0. It needs more discussion, development, testing, and feedback to mature before it's ready. There are concerns of rushing the API into Core before its ready as it will lock the API causing future needs limitations, backwards-compatibility issues, high maintenance burden, performance concerns (enqueuing only what is needed, handling of duplicate font variants, etc.), and plugin limitations for further customization (such as changing the font's source).
Style variations don't necessarily need a mature public API at this point. Rather, it needs the mechanisms to (a) wire fonts defined in
theme.json
to the pickers and (b) generate the font-face styles.What is your proposed solution?
Provide a stopgap solution for 6.0 where:
theme.json
file defines webfonts.Notes
Keeping the internals really private through abstraction or within a private container
From @peterwilsoncc:
Empowering ongoing API development in Gutenberg
A mechanism (such as a constant or filter) will be needed to disable this stopgap / temporary implementation once it lands in Core. Then Gutenberg can turn off Core's internal webfonts handling to use the Webfonts API.
Props
Props to @desrosj and @peterwilsoncc for proposing a pared down stopgap approach.
Tasks
theme.json
file.Status
The text was updated successfully, but these errors were encountered: