Skip to content
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

Page Editor: Fix Text global styles for block themes in simple sites #90784

Merged

Conversation

miksansegundo
Copy link
Contributor

@miksansegundo miksansegundo commented May 16, 2024

Related to #85798 p1715801793910199-slack-C03TY6J1A

Proposed Changes

  • Remove normalize_theme_slug from add_default_editor_styles_for_classic_themes

Note

normalize_theme_slug() is not required because get_stylesheet() returns the theme directory correctly prefixed for simple pub/{ theme directory } and atomic { theme directory }.

Why are these changes being made?

  • To fix a bug reported in p1715801793910199-slack-C03TY6J1A affecting only the page editor for block themes on simple sites
  • The bug overwrites the Text font with the default editor font
  • After the fix, the page editor sues the font from the theme for Text elements (paragraphs)

Testing Instructions

  • Sandbox a simple site with bedrock theme
  • Patch this diff with install-plugin.sh etk fix/default-styles-for-classic-themes-in-simple
  • Go to the Site Editor Styles > Typography > Text and set the font family to Pixeloid mono
  • Edit a page from https://wordpress.com/pages/{ SITE }, make sure it has some regular paragraphs
  • Verify the paragraphs use the font as on the screenshot

Test on Atomic:

  • Download the ETK plugin from Teamcity
  • Deactivate ETK on your atomic site
  • Upload and install the ETK you downloaded
  • Edit a page from https://wordpress.com/pages/{ SITE }, make sure it has some regular paragraphs
  • Verify the paragraphs use the font as on the screenshot
BEFORE AFTER
Screenshot 2567-05-16 at 13 10 28 Screenshot 2567-05-16 at 13 07 52

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@miksansegundo miksansegundo requested a review from a team May 16, 2024 06:23
@miksansegundo miksansegundo self-assigned this May 16, 2024
@matticbot matticbot added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels May 16, 2024
@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

Copy link
Contributor

@fushar fushar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on Simple and Atomic sites, and it works as expected 🎉

@miksansegundo miksansegundo merged commit cc132f2 into trunk May 16, 2024
15 of 16 checks passed
@miksansegundo miksansegundo deleted the fix/default-styles-for-classic-themes-in-simple branch May 16, 2024 07:27
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants