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

Column Block: Add color and padding support to individual column block #31778

Conversation

andrewserong
Copy link
Contributor

@andrewserong andrewserong commented May 13, 2021

Description

  • Add color support for the individual Column block
  • Add padding support for the individual Column block

Note: I've left padding / margin support out of the Columns block for the moment.

Related to #30753

How has this been tested?

Manually — add a columns block to a post, and test setting colours at the individual column block level. Blocks within the column block should override colors set at the column block level. Also, test the Padding settings under Spacing on the individual Column block.

Screenshots

Setting padding to 1em we can get the headings to line up between the column with a background color, and the column without a background color:

image

Types of changes

New feature (non-breaking change which adds functionality)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

Copy link
Contributor

@aaronrobertshaw aaronrobertshaw 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 adding the color support @andrewserong 👍

Tests well for me.

I'm not certain regarding the new CSS style though. It would conflict with theme set values once padding support is added. I'd be inclined to omit it from this PR as it would only have to be removed later.

@andrewserong
Copy link
Contributor Author

Thanks for testing! It looks a little weird without padding altogether, so I'll group this change with adding in padding support, too.

@andrewserong andrewserong changed the title Column Block: Add color support to individual column block Column Block: Add color and padding support to individual column block May 13, 2021
@andrewserong
Copy link
Contributor Author

Updated to remove the CSS rule, and add in padding support to the individual column block.

@aaronrobertshaw aaronrobertshaw self-requested a review May 13, 2021 01:50
Copy link
Contributor

@aaronrobertshaw aaronrobertshaw left a comment

Choose a reason for hiding this comment

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

LGTM ✨

One minor question. Is the intention to add padding support to the columns block separately? That will just be a simple opt-in to the padding support as well.

@andrewserong
Copy link
Contributor Author

Thanks @aaronrobertshaw!

One minor question. Is the intention to add padding support to the columns block separately? That will just be a simple opt-in to the padding support as well.

Yes, I ran into a bit of odd behaviour with the interactions between setting padding at the Columns block level and figuring out the inner spacing (or margins) between the individual column blocks, so thought I'd try splitting these out for the time being. Also the parent Columns block currently has the following CSS rule which could cause us issues, so I thought that might be better to figure out on another PR in case it takes a little longer to fix up:

	&.has-background {
		padding: $block-bg-padding--v $block-bg-padding--h;
	}

@aaronrobertshaw
Copy link
Contributor

Sounds like a plan. Once the tests pass we should be right to merge this.

@aaronrobertshaw
Copy link
Contributor

All tests are now passing. I've manually re-tested this as well and it's still working nicely 👌

I'll merge this and we can iterate on the parent columns block as discussed.

@aaronrobertshaw aaronrobertshaw merged commit 29078b0 into WordPress:trunk May 18, 2021
@github-actions github-actions bot added this to the Gutenberg 10.7 milestone May 18, 2021
@aaronrobertshaw aaronrobertshaw added [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 [Type] Enhancement A suggestion for improvement. labels May 18, 2021
@andrewserong andrewserong deleted the add/color-support-to-individual-column-block branch May 24, 2021 02:02
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 [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants