You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changing the font family on a block adds both a class and inline styles to the block when rendered in the browser. This behavior is expected and allows one to select a font family.
However, an issue arises when the font family previously assigned to a block is removed from the Font Library. In such cases, the associated class and inline style remain on the block even though the font is no longer available.
Expected Behavior:
One of the expected behaviors is that when a font family is removed from the Font Library, any block that previously utilized this font should have the default font family set and its associated class and inline style cleaned up.
Step-by-step reproduction instructions
Add a new font family from the Font Library modal.
Apply this font family to a block and observe the addition of the corresponding class and inline style to the block on the front of the site.
Remove the added font family from the Font Library modal.
Observe that, despite the absence of the font, the block retains the class and inline style that references the removed font.
Screenshots, screen recording, code snippet
Environment info
Gutenberg >= 17.6
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
No
The text was updated successfully, but these errors were encountered:
👋 thanks for testing and submitting issues @okmttdhr ! :)
I think this is the expected behavior. It works as any other theme.json setting: any setting added to theme.json that's applied to an element but after that removed from theme.json file will act the same way. If the setting is re-added, the element render as expected. With fonts, it happens the same; if a font is installed, applied to elements, uninstalled, and finally installed again, the elements will display the font as expected. Removing the class would result in the element won't display it, which seems unexpected.
This is mostly unrelated to the font library functionality and depends on how global styles and styles engine work.
If this rationale makes sense, I propose to close this issue.
Description
Changing the font family on a block adds both a class and inline styles to the block when rendered in the browser. This behavior is expected and allows one to select a font family.
However, an issue arises when the font family previously assigned to a block is removed from the Font Library. In such cases, the associated class and inline style remain on the block even though the font is no longer available.
Expected Behavior:
One of the expected behaviors is that when a font family is removed from the Font Library, any block that previously utilized this font should have the default font family set and its associated class and inline style cleaned up.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Environment info
Gutenberg >= 17.6
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
No
The text was updated successfully, but these errors were encountered: