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

Buttons: Add border, color, and padding block supports #63538

Merged
merged 2 commits into from
Jul 16, 2024

Conversation

aaronrobertshaw
Copy link
Contributor

@aaronrobertshaw aaronrobertshaw commented Jul 15, 2024

Part of: #43241

What?

Adopts background color, padding, and border block supports for the Buttons block.

Why?

  • Offers greater design flexibility
  • Improves consistency in design tooling with other blocks

How?

  • Adopts new block supports

Testing Instructions

  1. In the site editor add a Buttons block to a page
  2. Within Styles > Blocks > Buttons, configure new background, padding, and border values
  3. Save and confirm the Buttons block is styled appropriately in the editor and frontend
  4. Back in the editor select the Buttons block and switch to the block inspector
  5. Configure new styles for background, padding, and border on the block instance
  6. Save and confirm these display correctly in the editor and frontend

Screenshots or screencast

Screen.Recording.2024-07-15.at.12.20.58.PM.mp4

@aaronrobertshaw aaronrobertshaw added [Type] Enhancement A suggestion for improvement. [Block] Buttons Affects the Buttons Block CSS Styling Related to editor and front end styles, CSS-specific issues. labels Jul 15, 2024
@aaronrobertshaw aaronrobertshaw self-assigned this Jul 15, 2024
Copy link

github-actions bot commented Jul 15, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: aaronrobertshaw <aaronrobertshaw@git.wordpress.org>
Co-authored-by: carolinan <poena@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@aaronrobertshaw aaronrobertshaw added the [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi label Jul 15, 2024
@carolinan
Copy link
Contributor

carolinan commented Jul 15, 2024

With color support enabled, the option to add color for the button element is enabled on the parent buttons block, is that correct?

@aaronrobertshaw
Copy link
Contributor Author

Thanks for testing @carolinan 👍

With color support enabled, the option to add color for the button element is enabled on the parent buttons block, is that correct?

This PR only proposes to add background color support to the wrapping Buttons block rather than text color for all internal buttons. With the way individual buttons are structured, I'd like to address text color for inner Button blocks separately.

@carolinan
Copy link
Contributor

I meant this button color support: "color (background, button, gradients, text),"
With this option, you can set both the background and text color of the inner button.

@aaronrobertshaw
Copy link
Contributor Author

Sorry @carolinan, I'm not following 😅

I meant this button color support: "color (background, button, gradients, text),"
With this option, you can set both the background and text color of the inner button.

Is the confusion that the docs strike out the text support to show it has been opted out of?

You'll see that the text color support for the parent Buttons block is disabled here.

@carolinan
Copy link
Contributor

No, I am finding it confusing that the parent now has any settings for the inner button.
(One of the reasons why it is confusing is the problem where the controls on the inner button do not show the inherited colors)

I only mentioned the text because I interpreted this as it should not be possible to set the text color on the inner button from the parent:

This PR only proposes to add background color support to the wrapping Buttons block rather than text color for all internal buttons. With the way individual buttons are structured, I'd like to address text color for inner Button blocks separately.

Because with this change it is possible to set the text color of the inner button from the parent.
button-element

@aaronrobertshaw
Copy link
Contributor Author

Thanks for the clarification, I think I'm on the same page now 👍

What's highlighted in the screenshot is actually the button element styles not inner button block controls. I'll see what I can do to reduce the potential for confusion here.

@carolinan
Copy link
Contributor

Thanks for the clarification, I think I'm on the same page now 👍

What's highlighted in the screenshot is actually the button element styles not inner button block controls. I'll see what I can do to reduce the potential for confusion here.

Yes 😄

With color support enabled, the option to add color for the button element is enabled on the parent buttons block, is that correct?

@aaronrobertshaw
Copy link
Contributor Author

Apologies for my earlier confusion @carolinan.

It was staring me in my face and I kept reading the config as background not button 🙈

Now my tunnel vision has dissipated, let's leave the element styling out for now. While it does give users the option to bulk style all buttons it can be confusing. Discussing or implementing that as a separate follow-up sounds like the best path forward for now.

I've removed the button element support in 4879255

Screenshot 2024-07-16 at 4 09 38 PM

@aaronrobertshaw aaronrobertshaw merged commit e8cba7c into trunk Jul 16, 2024
61 checks passed
@aaronrobertshaw aaronrobertshaw deleted the add/buttons-block-supports branch July 16, 2024 06:47
@github-actions github-actions bot added this to the Gutenberg 18.9 milestone Jul 16, 2024
carstingaxion pushed a commit to carstingaxion/gutenberg that referenced this pull request Jul 18, 2024
Co-authored-by: aaronrobertshaw <aaronrobertshaw@git.wordpress.org>
Co-authored-by: carolinan <poena@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Buttons Affects the Buttons Block CSS Styling Related to editor and front end styles, CSS-specific issues. [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants