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

Block library: Refactor Verse block to use class names for text align #16777

merged 1 commit into from Jul 31, 2019


Copy link

@gziolo gziolo commented Jul 26, 2019


Related: #16027, #15751

This PR follows-up #16035 and fixes #15751.

Currently the verse block get an inline style after selecting a specific alignment.

<pre style="text-align:left" class="wp-block-verse">Content</pre>

This is an unexpected behavior and should work like this:

<pre class="wp-block-verse alignleft">Content</pre>

Without adding the alignment class, I can't set any specific theme side styles for the alignment of verse block.


<!-- wp:verse {"textAlign":"right"} -->
<pre style="text-align:right" class="wp-block-verse">A <em>verse</em><br>And more!</pre>
<!-- /wp:core/verse -->


<!-- wp:verse {"textAlign":"right"} -->
<pre class="wp-block-verse has-text-align-right">A <em>verse</em><br>And more!</pre>
<!-- /wp:verse -->

How has this been tested?

Using one of the existing branches (master probably) add a few Verse blocks and set different text alignments and save your post. Open the same post with this branch and ensure that it still works


  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.

Copy link
Member Author

gziolo commented Jul 31, 2019

Applying Needs Dev Note as this might have an impact on themes which used the presence of style as a way to change the visual aspect of the block.

@gziolo gziolo merged commit 916cbb0 into master Jul 31, 2019
12 of 16 checks passed
@gziolo gziolo deleted the update/verse-text-align branch Jul 31, 2019
@gziolo gziolo added this to the Gutenberg 6.3 milestone Aug 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
[Block] Verse [Package] Block library [Type] Enhancement
None yet

Successfully merging this pull request may close these issues.

3 participants