Directory

Columns: Adopt button and heading element colors by aaronrobertshaw · Pull Request #54104 · WordPress/gutenberg · GitHub
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

Columns: Adopt button and heading element colors #54104

Merged
merged 1 commit into from
Sep 1, 2023

Conversation

aaronrobertshaw
Copy link
Contributor

Related:

What?

Adds the ability to specify colors for button and heading elements with Column/s blocks instances.

Why?

Provides greater flexibility in styling sections that may differ from the overall global styles e.g. a call-to-action pattern that might be darker or lighter than the overall theme.

How?

Opts into button and heading color support.

Known Issues

There are some existing issues with the generic heading element gradient backgrounds overriding a simple background color on specific h1-h6 elements. Similarly, a gradient applied by the container block can't be overridden by a simple background color set via an individual block within the container. These will be addressed separately.

Next Steps

The might be further container like blocks that we could opt into this color support for e.g. Cover, Media & Text, Details, Post Template etc.

Testing Instructions

  1. Edit a post and add a Columns block and select a multi-column layout for the inner columns
  2. In each column add a few different levels of headings along with a button or two
  3. Select the overall Columns block
  4. In the Block Inspector > Styles > Color panel, toggle on button and heading color controls
  5. Adjust color for buttons and heading elements (check preset and custom colors, gradients etc). All the button and heading elements within the columns should reflect the correct color
  6. Select a specific heading element now (h1 - h6) that matches one of the headings and confirm that overrides the generic heading element style selected earlier
  7. Repeat the process, selecting one of the inner columns, checking their button/heading colors update appropriately
  8. Save the post and confirm the colors are correct on the frontend

Screenshots or screencast

Screenshot 2023-09-01 at 3 13 49 pm

@aaronrobertshaw aaronrobertshaw added [Type] Enhancement A suggestion for improvement. [Block] Columns Affects the Columns Block [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi labels Sep 1, 2023
@aaronrobertshaw aaronrobertshaw self-assigned this Sep 1, 2023
Copy link
Contributor

@andrewserong andrewserong left a comment

Choose a reason for hiding this comment

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

Thanks for putting this up, I had a feeling I might see a PR like this just around the corner 😀

✅ Columns-level elements styles are output correctly in editor and site frontend.
✅ Column-level elements styles correctly override Columns-level styles.
✅ Block-level elements styles correctly override Column and Columns-level styles, with the caveat about gradients as mentioned in the PR description.

image

There might be further container like blocks that we could opt into this color support for e.g. Cover, Media & Text, Details, Post Template etc.

Excellent! Cover block sounds like a good next candidate to me 🙂

LGTM! ✨

@aaronrobertshaw aaronrobertshaw merged commit 8e0fdca into trunk Sep 1, 2023
59 checks passed
@aaronrobertshaw aaronrobertshaw deleted the add/button-heading-colors-to-columns branch September 1, 2023 06:31
@github-actions github-actions bot added this to the Gutenberg 16.7 milestone Sep 1, 2023
@Marc-pi
Copy link

Marc-pi commented Sep 1, 2023

@andrewserong / @aaronrobertshaw nice. the day you will add shadow on column/columns (#44651) and column radius #41345 our price lists will say hourra ! ;-)
nice addition here already, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Columns Affects the Columns Block [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi Needs User Documentation Needs new user documentation [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants