Skip to content

Standardize alignment options for blocks based off of WP widgets#9557

Closed
ZebulanStanphill wants to merge 5 commits intoWordPress:masterfrom
ZebulanStanphill:update/standardize-alignments-for-widget-blocks
Closed

Standardize alignment options for blocks based off of WP widgets#9557
ZebulanStanphill wants to merge 5 commits intoWordPress:masterfrom
ZebulanStanphill:update/standardize-alignments-for-widget-blocks

Conversation

@ZebulanStanphill
Copy link
Copy Markdown
Member

Description

Currently, the blocks based off of WordPress widgets seem to have little to no consistency in what alignment options they support. One would support all alignments while another only supported left, right, and center. Another would support center, wide, and full, but not left and right.

This PR gets rid of all these inconsistencies by making the blocks based off of WordPress widgets all support every alignment option.

It also simplifies the checks for valid alignment values using the Array.prototype.includes function.

Additionally, I managed to fix a couple bugs while I was at it:

  • I managed to figure out how to fix Alignment: categories block forces aligncenter regardless of what is selected in the toolbar #7910.
  • I made it so that the Archives block uses no alignment class when no alignment set, rather than using an alignnone class, which was inconsistent with other blocks.
  • I fixed the Archives block not working with custom classes. (The className attribute used for custom classes was not defined and was not being appended to the output class HTML attribute of the block.)

Fixes #7910. Closes #8777. Closes #9413. Solves some cases of #7908, but there are still some cases of that issue that involve non-widget blocks. I think I should tackle those in another PR.

@ZebulanStanphill
Copy link
Copy Markdown
Member Author

Fixed tests that were failing. Ready for feedback and review.

@kjellr
Copy link
Copy Markdown
Contributor

kjellr commented Sep 7, 2018

Hey @ZebulanStanphill — would you mind adding a few screenshots of those blocks to this thread for quick reference? That'll help give us a clear sense of what's changed. Thanks!

@ZebulanStanphill
Copy link
Copy Markdown
Member Author

@kjellr I have decided to split this PR into several smaller ones, starting with #9696.

@ZebulanStanphill ZebulanStanphill deleted the update/standardize-alignments-for-widget-blocks branch November 2, 2018 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Blocks Overall functionality of blocks [Type] Enhancement A suggestion for improvement.

Projects

None yet

2 participants