WordPress / twentytwentytwo

Twenty Twenty-Two, the default WordPress theme that will launch with WordPress 5.9.
405 stars 92 forks source link

Use --wp--custom--spacing--small instead of hard-coded spacing styles #316

Closed richtabor closed 2 years ago

richtabor commented 2 years ago

Description

Closes #309 and closes #317 by using var(--wp--custom--spacing--small, 1.25rem) in place of the hard-coded max(1.25rem, 5vw) styles within patterns. This way if a user modifies the theme's theme.json settings.custom.spacing.small value, it is reflected throughout the theme.

Testing Instructions

  1. First - without this PR - add a pattern and change the settings.custom.spacing.small value
  2. See no changes, as the max(1.25rem, 5vw) values are hard-coded into the patterns
  3. With this PR active, add any of the changed patterns to a page
  4. Change the settings.custom.spacing.small value in theme.json
  5. See the spacing adapt on the page.