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
merged 1 commit into from Jul 31, 2019

Conversation

@gziolo
Copy link
Member

commented Jul 26, 2019

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.
@gziolo

This comment has been minimized.

Copy link
Member Author

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

1 of 16 checks passed

Milestone It Milestone It
Details
Milestone It Milestone It
Details
Milestone It Milestone It
Details
Milestone It Milestone It
Details
Milestone It Milestone It
Details
Milestone It Milestone It
Details
Milestone It Milestone It
Details
Milestone It Milestone It
Details
Milestone It Milestone It
Details
Milestone It Milestone It
Details
Milestone It Milestone It
Details
Milestone It Milestone It
Details
.github/main.workflow .github/main.workflow
Details
.github/main.workflow .github/main.workflow
Details
.github/main.workflow .github/main.workflow
Details
Travis CI - Pull Request Build Passed
Details

@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
You can’t perform that action at this time.