Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

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

Merged
merged 3 commits into from Jan 4, 2022
Merged

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

merged 3 commits into from Jan 4, 2022

Conversation

richtabor
Copy link
Member

@richtabor richtabor commented Jan 3, 2022

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.

Copy link
Collaborator

@kjellr kjellr left a comment

Choose a reason for hiding this comment

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

This works well, thanks @richtabor!

@kjellr kjellr merged commit a4a632f into WordPress:trunk Jan 4, 2022
@kjellr kjellr added this to the RC 2 milestone Jan 4, 2022
@richtabor richtabor deleted the enhance/309 branch January 4, 2022 13:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants