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

Unregister the global-styles from classic themes #166

Merged
merged 2 commits into from
Feb 22, 2022

Conversation

ryelle
Copy link
Contributor

@ryelle ryelle commented Feb 17, 2022

Fixes #86 — By default, Gutenberg outputs some basic presets (font sizes, colors, etc). The News theme overwrites a few of them (by virtue of using the same slugs), like font-sizes. In the header & footer, the font size is set to --wp--preset--font-size--small, which should be 14px (set by News), but the default global-styles code resets it to 13px on classic themes.

The news styles output in global-styles-for-classic-themes includes the gutenberg default presets, so we can safely remove the second set of custom property definitions from classic themes.

To test:

  • Visit a classic theme (ex, learn) on desktop
  • The header & footer font sizes should be 14px
  • Visit News
  • The header & footer font sizes should be 14px
  • There should be no other visible changes on either News or classic themes

@ryelle ryelle self-assigned this Feb 17, 2022
Copy link
Contributor

@coreymckrill coreymckrill left a comment

Choose a reason for hiding this comment

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

👍 Worked in testing on sandbox

@ryelle
Copy link
Contributor Author

ryelle commented Feb 18, 2022

This has the side-effect of removing all the has-* classes, but 666e2ef brings them back.

Tested by going to a page with the default styles, ex the "January" button on this page Keeping up with Gutenberg: Index 2022 .

Before After

@ryelle ryelle merged commit ad666d3 into trunk Feb 22, 2022
@ryelle ryelle deleted the fix/duplicate-global-styles branch February 22, 2022 19:27
dd32 added a commit that referenced this pull request Feb 24, 2022
Deregistering the style will cause the style not to be output, but it will remain in the style stack and be detected as unoutputable at render time.

By dequeueing the style first, it removes it from the stack to print.

This fixes Query Monitor throwing a visual warning on classic themes.

See #166, #86
ryelle pushed a commit that referenced this pull request Feb 24, 2022
Deregistering the style will cause the style not to be output, but it will remain in the style stack and be detected as unoutputable at render time.

By dequeueing the style first, it removes it from the stack to print.

This fixes Query Monitor throwing a visual warning on classic themes.

See #166, #86
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Classic themes: Double global styles
2 participants