-
Notifications
You must be signed in to change notification settings - Fork 4.8k
[Styles] Webfonts enqueued using styles JSON files are not loaded #39702
Copy link
Copy link
Closed
Labels
Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.jsonAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.Questions or issues with incorporating or styling blocks in a theme.[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
Webfonts declared in custom styles json files are not enqueued. No error is thrown, but the fonts are not loaded in.
To reproduce:
- Add a style variation to emptytheme.
- Add font file(s)
- Declare the font using fontFace under
settings.typography.fontFamilies. - Open the Site Editor.
- Select the variation, notice that the correct font is not loaded.
Example PR here: WordPress/theme-experiments#304
In the PR example, the same code works properly when pasted into theme.json instead of styles/variation.json.
Screenshots:
The correct font for the variation should be DM Sans. Instead, the default sans-serif fallback is being used, and no network call to the DM Sans font files is being made.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.jsonAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.Questions or issues with incorporating or styling blocks in a theme.[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Type
Fields
Give feedbackNo fields configured for issues without a type.

