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

Feature: Add font sizes values from core into theme json #66

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

ian-pvd
Copy link

@ian-pvd ian-pvd commented Nov 30, 2021

Description of the Change

This PR adds the font size values defined in core to the theme scaffold.
The core font sizes were retrieved from here: https://github.com/WordPress/gutenberg/blob/26556937b70bbf4aaef8c112321703b61a740284/lib/theme.json#L196-L222

Alternate Designs

My original goal was to override a single core font size while leaving the other values intact, but this isn't possible.

Benefits

  • The font sizes that are available in Gutenberg by default will now be available to themes using the scaffold.
  • Default font sizes supported by WordPress will now be listed in our theme.json, making it easier to customize them.
  • Individual font size options can now be customized, without losing the other WP core font sizes.

Possible Drawbacks

  • Detaches our theme's font sizes from the font sizes defined in WP core.

Verification Process

  1. Installed a copy of the theme at trunk and confirmed that no font size options are availalble.
  2. Made changes, rebuilt the theme, and confirmed that the font sizes I added were available.
  3. Tried customizing a single font size option and was able to do so without losing or changing the other options.

Checklist:

  • N/A I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Applicable Issues

Relates to a conversation in Slack where I was trying to make changes to a single font size option, without losing the other WP core font size options.
https://10up.slack.com/archives/C8Z3WMN1K/p1638295806165800

Changelog Entry

Adds the default font-size options defined in core to the scaffold's theme.json file.

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.

1 participant