-
Notifications
You must be signed in to change notification settings - Fork 0
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
[BBT-121] Manage all styles #45
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found an issue with both the padding (shown below) and margin controls on blocks without existing padding/margin styles:
Screen.Recording.2023-12-04.at.16.19.17.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found an issue where you can't change the font appearance to anything but default/regular/regular italic:
Screen.Recording.2023-12-04.at.16.21.49.mov
5dff47f
to
f0b01be
Compare
Thanks @Joe-Rouse - I've fixed both of those issues now and re-checked all inputs, nothing else is coming up for me. The padding/margin one was similar to the previous issues, I had just missed it. The font updating one was a little different, perhaps it wasn't showing up until this refactor, but we were attempting to update the config object twice during the same action which caused only one of the values to update. Refactoring the onChange handler to accept an object rather than a value and a single key prevents this, and with hindsight may be a better approach overall. |
@g-elwell Looks pretty good to me now. One thing I was wondering before approving though, do you know why some of these blocks aren't greyed out even when using an empty theme.json ( I only get it on those two and the columns block. |
Yeah, it looks as though WP hard-codes some base styles even when the theme Core theme.json is here: https://github.com/WordPress/wordpress-develop/blob/6.4/src/wp-includes/theme.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Tested where I can and I can't make it crash anymore. Other features like the theme.json
exporter/, reset etc. all still work as expected.
Description
Fixes BBT-121 - Allows the addition and editing of style attributes even when they are not present in the original theme.json file
This PR builds on previous work on style components, and simply removes their conditional rendering so that they are always present on every block/element/pseudo-element.
There were a few adjustments to be made to accommodate undefined variables, but once addressed the components work as expected, allowing users to save and edit styles.
Change Log
StylesColor
- render colour pickers for "background" and "text" rather than checking for presence in the themeSteps to test
{}
)inert
attribute from the preview container (see video)Screenshots/Videos
Screen.Capture.on.2023-12-04.at.14-53-30.mov
Checklist: