Skip to content

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

Merged
gziolo merged 1 commit into
masterfrom
update/verse-text-align
Jul 31, 2019
Merged

Block library: Refactor Verse block to use class names for text align#16777
gziolo merged 1 commit into
masterfrom
update/verse-text-align

Conversation

@gziolo

@gziolo gziolo commented Jul 26, 2019

Copy link
Copy Markdown
Member

Description

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.

Before:

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

After:

<!-- 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

Checklist:

  • 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.

Comment thread packages/block-library/CHANGELOG.md
@gziolo gziolo added the Needs Dev Note Requires a developer note for a major WordPress release cycle label Jul 31, 2019
@gziolo

gziolo commented Jul 31, 2019

Copy link
Copy Markdown
Member Author

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
@gziolo gziolo deleted the update/verse-text-align branch July 31, 2019 13:59
@gziolo gziolo added this to the Gutenberg 6.3 milestone Aug 6, 2019
@youknowriad youknowriad removed the Needs Dev Note Requires a developer note for a major WordPress release cycle label Sep 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Verse Affects the Verse block [Package] Block library /packages/block-library [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Verse Block: Alignment uses inline styles

3 participants