-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Adding a theme.json file removes the Gutenberg font stack #69396
Comments
Is there an issue with adding your preferred font family in theme.json? It is its purpose. |
I didn't have a preferred font family, I just wanted to use a |
"Use theme styles" does not "hide some panels in the editor". What I tried to say that the purpose of theme.json is to add new defaults. |
This style is defined here: gutenberg/packages/block-library/src/reset.scss Lines 10 to 13 in e093fef
This style exists to prevent the non-iframe editor from inheriting admin styles.
This font-family is defined in the core for the dashboard and should not be inherited by the editor. If the editor is not an iframe, it will be affected by the WP-Admin styles. To make the editor layout match the frontend, there are some reset styles that override the WP-Admin styles. I think |
Description
When I add a
theme.json
to my project, the title's font regresses to an ugly serif, Times New Roman in my case. Inspecting with dev tools shows that the following selector inload-styles.php
is responsible for this:...and disabling it reverts back to the default font stack of:
The problem is that
load-styles.php
seems to be a Wordpress core file and changing it would require other measures to make sure future updates don't replace it. I know workarounds exist, but I don't think extra code should be needed since this is a bug that preventstheme.json
from being used the way the documentation says it should be.Step-by-step reproduction instructions
theme.json
:Start creating a new post in the Gutenberg editor and type a title - the content will be aligned left and in a serif font
Adding "contentSize" fixes the left-alignment, but there doesn't seem to be any fix for the unset font stack
Screenshots, screen recording, code snippet
No response
Environment info
6.7.2, unknown Gutenberg version, and Blocksy version
Windows 10 desktop, Firefox and Chrome
Local development environment with spotty HTTPS support, if it makes a difference
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
The text was updated successfully, but these errors were encountered: