-
Notifications
You must be signed in to change notification settings - Fork 360
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 Blockbase Google Fonts to Locally Hosted ( DO NOT MERGE ) #6010
Conversation
Thanks for this! the team is in a meetup this week, I added this PR to our board so we'll review as soon as possible |
TestingRequirementsCustom fonts in the site editor
Google Fonts Jetpack module
Browsers
|
Noting that the "Use Site Editor" link in the Fonts section of the Customizer is meant to open the Site editor with the Global Styles panel open. This doesn't currently work with the WP 6.0 release candidate... tracking that in https://core.trac.wordpress.org/ticket/55752. |
🎉 🎉 🎉 Tested for dotcom simple sites. I can confirm that a site with legacy blockbase custom fonts was migrated successfully. One thing to note is that I couldn't confirm the heading font was mapped to global styles heading blocks because typography settings won't be exposed until Gutenberg v13.3. Fonts did map successfully to the global styles post title block though. To save others the trouble, I navigated to the themes/blockbase directory in my local machine from the terminal. Then I ran this command I'll test this for atomic sites tomorrow. |
I tested this locally, with Gutenberg installed but not Jetpack on a site running Quadrat with custom fonts selected via the customizer. As soon as I checked out this branch, the fonts stop working, they are not being loaded at all. I don't see the font-face rules either for them, but the CSS is requesting the correct font family name. |
I have a hunch that this is related to the testing environment and not the code itself -- things had to be run in a specific way when I was testing the PR alongside @creativecoder. Taking a look at your issues today. |
229eebf
to
1ed7cdb
Compare
@MaggieCabrera thanks for the patience in testing. It turns out that what you found was, indeed, a bug 😅 I've been mistakenly thinking that the behavior we've been seeing has been a caching issue, because, when we select the font in global styles and refresh the page, the font does load properly. The issue was that @creativecoder and I didn't realize that font enqueueing for the editor and the front share the same url generation method We now enqueue all google fonts options in the editor. The issue should be fixed now 🎉 Note: |
I'm sorry but something is still broken for me. I tested on a fresh site, my setup is basically a fresh install using Local by Flywheel with a symlink to my themes and plugin folder (using Gutenberg trunk). I'm testing again with Quadrat, first selecting fonts in the customizer while on trunk, then switch to this branch and check the frontend. In this case I see that the CSS variable that should be applied is not defined: Debugging this a bit I see that when running |
c2c448f
to
4c06af4
Compare
Thanks again for the patience @MaggieCabrera! I think we've got the issues sorted this time. I tested our changes for Quadrat in the editor + frontend and things should be working as expected. We, ultimately, had to do a noticeable amount of refactoring behind the scenes. We're effectively copying the functionality for custom google fonts from the dotcom Jetpack custom fonts implementation. The end result, however, is still the same, and delivers the same functionality that we agreed upon earlier paYE8P-1B3-p2#comment-1526.
This PR is ready for review again 👍 |
4c06af4
to
aca3fb2
Compare
Considering that there will be themes in the wild that we don't have control of that handle fonts in the same way that Quadrat does I'm extra keen to solve this in a way that doesn't require changes to the child theme. I'm going to tinker with that today and see if I can come up with any suggestions. The 'heading-font' and 'body-font' is the part I mentioned earlier where some themes were depending on those values in their patterns/settings. It's not guaranteed to be consistent across themes how each of those values are used, only that they had been available to use. |
4399a22
to
a6bdb08
Compare
After more consideration, @creativecoder and I took a closer look and realized that we could automatically enqueue default Blockbase theme google fonts. See our latest commit a6bdb08. It appears as if the bug is fixed, and it seems like the solution satisfies all of the constraints you mentioned earlier:
Thoughts? |
Brilliant! Love it, it's the perfect fix for that situation IMO. Now a child theme doesn't have to be updated to continue to work as expected. That said a few child themes do have reference to heading-font and body-font outside of the defaults being set in the migration logic. I think the best bet for those (few) cases are to go ahead and commit those changes to configuration. Meraki (another) ...and I think that's it for the Blockbase children. So only Meraki really NEEDS to be updated with this change to maintain design. (Note: I haven't looked for the same in any of the /premium blockbase children). Just a few more (housekeeping) changes I suggest;
|
270477e
to
7728c2c
Compare
Addressed the comments. I removed the unnecessary fonts files and moved fonts logic into the Hopefully everything looks good now. As far as the update to premium themes, let me know how I can coordinate the deploy of this PR with your changes to premium logic. |
I have no intentions of updating any premium themes, I just wanted to point out that they should. :) I understand the changes to Blockbase will be pulled into the "premium" version at which point any changes like those for Meraki will need to happen then. I'm not sure who will coordinate that. As to the rest of the changes I think we're solid! Thanks for working so hard on this! I'mma approve these changes though I'm also going to stick a "do not merge" tag on this change as well. I intend for this change and the color customization change to ship together in a major point release later this week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A LOT OF WORK HERE!
A good change and improvement to Blockbase.
Approving, requesting that it wait to be merged.
Gotcha 👍 Thanks for clarifying!
Thanks for sticking with us through the reviews -- it's been much appreciated 🙏
To make sure we're on the same page, does that mean the themes team will be handling deployment of this PR? To set expectations, I'm planning to head off on a vacation soon. Grant is also on a separate team now, so he'll be prioritizing separate work. |
Yes, I would like to coordinate the release with a few other things. Since it's a fairly fundamental change to how Blockbase is managed I think it needs a major release. I'll merge the change in the next few days. |
I just noticed this, and I'm not sure why, but with this branch applied the site-title doesn't obey the font size values assigned via theme.json Global Styles: Rebasing to trunk didn't help. --- [UPDATE] --- So far I've only been able to trace this happening upon the action in the
With that bit removed the site-title global styles attributes are again applied. I can't find any reason why the above logic should prevent those styles (or any others) from being applied but this is as far as I was able to trace the behavior. Note that this is effecting child themes as well (as I would have expected): |
Found an error to be addressed before this can ship.
Im trying to repro but am unable. If I have font size set by the block setting, that value is reflected. If i remove that and set a font size in GS -> Blocks -> Site Title -> Typography, that value is reflected. Do you have more info on how to repro? I tested this by syncing this build to my sandbox and testing on a simple site. |
After further testing, Addie and I were able to reproduce the issue. One other bug to note is that saving block level global styles changes doesn't work either. The saved values appear to revert to the original body font ( e.g. global styles < blocks < post title < typography < font family modifications don't persist and revert to the body font ) We did some preliminary investigation, and the culprit has something to do with the newest Gutenberg version (v13.5). We tested this PR alongside Gutenberg v13.3 and the site title renders properly in that instance. The saving bug noted above is also fixed. After running a
@pbking hoping to clarify expectations here. Is the themes team going to handle the error and push a fix? This is looking like a rabbit hole, and Team Cylon has shifted focus to work on the help center. Happy to discuss this further 👍 |
Putting this PR on hold until we settle on a path forward with GDPR concerns p1655712801370349-slack-C029FM1EH |
@jeyip yes I'm currently pouring all of my time into the Blockbase font management issue, and while I'm particularly focused on the GDPR concerns mentioned I'm also planning to work through the |
Closing this in favor of #6123 for now |
Changes proposed in this Pull Request:
Note: This migrates the Heading font from the Customizer to the Global Styles settings for the Post Title and Heading blocks. The Heading block typography settings require Gutenberg 13.3, which has not yet been released, so this PR should wait to be merged until then.
Testing Instructions
trunk
) and Global Styles > Blocks > Post Title > TypographyNote:
blockbase_legacy_font_settings
from wp_options database table to trigger the settings migration (migration only runs when this option is not present).