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

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

Closed
wants to merge 5 commits into from
Closed

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

wants to merge 5 commits into from

Conversation

ZebulanStanphill
Copy link
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
Member Author

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

@kjellr
Copy link
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
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