-
Notifications
You must be signed in to change notification settings - Fork 360
Blockbase: Refactor Button Color styles #4439
Conversation
Thanks for looking into this! I've noticed a couple of things: First of all this PR breaks the hover on the frontend like this And also I think we are overriding too many of the styles we define on theme.json with our CSS: Skatepark theme.json defines:
And we are redefining these values with our |
Did you check out this PR WordPress/gutenberg#34147 when testing this? It's needed to make sure that blockbase's CSS doesn't override global styles inline CSS.
If a user changes the button block colors globally, we do not have a way handling the hover state so it will look broken. |
I think this is ready for another review. It removes the button block CSS that was overriding what was already being set by theme.json. It does not require the Gutenberg ordering change above to solve the issue. Testing instructions
|
TestingRequirements
Browsers
Notes
|
d3cd6d5
to
6f24f31
Compare
I reworked how this works a little bit and would appreciate another review @jeyip if you are so inclined. This change doesn't effect the specificity at all, however it does remove from the button block styles anything controlled by Global Styles (leaving only hover state styles applied). Additionally all "padding" stuff has been removed from the styles and theme.json. I believe this was in place in order to match styles with non-block buttons, however that doesn't appear to be a useful thing after all. The change seems to cover all of the points raised above with the benefit of simplifying the code in question. |
Seeing some problems with padding that I created with the change... working through that. |
6f24f31
to
8ee8ae5
Compare
Ok, dropped this down to the SMALLEST possible change to achieve the desired result. GLOBAL PADDING CONFIGURATION OF BUTTONS continues to NOT WORK. Global configurations of padding will be overwritten by the theme due to how OUTLINE STYLES and other theme-specific stylistic concerns for outlines and hover states. All Blockbase themes have been tested to work. |
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.
@pbking I think the golf change here is the right way to go while other issues in Gutenberg are discussed / worked out.
I was unable to test in Skatepark or Quadrat because of Site Editor issues, but Blockbase is looking great.
I noticed a small issue with the search block's button missing a cursor: pointer;
, but I don't think that should hold this one up.
🚢
Just want to make sure we're on the same page — at this time, changing the color of the button block in the global styles panel will not change the color of buttons everywhere (e.g. buttons in forms, the search block, file block). This is not because of anything the theme is doing or can be expected to do. I do agree this is a gap in the experience and should be considered. That discussion is documented a bit here: pNEWy-ecm-p2 and here WordPress/gutenberg#34206 In other words, this PR shouldn't break or create inconsistencies in the default styling of buttons, but it also can't make button colors match when a user makes changes to the button block in the global styles panel. What do you think? Is there anything else you imagine from this PR before bringing it in? |
I gave this one more spin, still working as expected. Going to bring this in as it's a pretty minimal change that solves the issue of global button color styles not being respected. If we need to look at it again we can, thanks everyone. |
Super strange 🤔 Somehow I didn't see the pings. My mistake for missing them, and big thanks to @pbking + @jffng for taking care of this. I'll be sure to catch up on the code changes and the P2 this afternoon. |
I reviewed the work, and I think what y'all have done makes a lot of sense. I'll be sure to communicate the limitations to #cylon.
💯 Totally agree with this sentiment. The button block per-block global styling now behaves as expected, but the overall global styling experience itself could use improvement. Thanks for making the corresponding Github issue ⭐ |
Changes proposed in this Pull Request:
This PR is an attempt to solve one part of #4435 by lowering the CSS specificity of the button styles. It removes the hover styles for now while we discuss a way forward there.
We discussed a few ideas p1629312308145500/1629295598.131100-slack-C029FM1EH, I'm not sure this is the right approach but wanted to get a feel for the problem and spark a discussion in any case.
To test
Check out Global Styles: enqueue styles later so theme css can load first WordPress/gutenberg#34147Related issue(s):
#4435