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

[112] - Stop spacing from being cleared #119

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

Conversation

jordanharris-6
Copy link
Contributor

@jordanharris-6 jordanharris-6 commented Nov 13, 2024

Description

112 - When trying to parse spacing values, if the value was a variable such as var(--wp--preset--spacing--20) it would just set the value to 0px this PR fixes this issue and also fixes an issue where if you changed the value the value would have no unit at the end. It now defaults this to PX

Change Log

  • Adds a function to check if a unit exists and if it doesn't it adds PX
  • Returns the original value instead of 0px

Steps to test

Make sure you have the twenty twenty four theme active
Go to appearance > styles editor
Open the blocks menu and go to the quote block
You should see it has a variable as the value and if you change it a PX value is automatically added.

Screenshots/Videos

http://bigbite.im/v/kvoKQa

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

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