-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Verse Block: Adds support for custom padding #27341
Conversation
Size Change: +382 B (0%) Total Size: 1.19 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it works. You better check with someone else more familiar with how Global Styles are designed to work but according to my understanding this is correct.
One unit test fails, running |
I tried to test with: <!-- wp:verse {"style":{"typography":{"fontFamily":"var:preset|font-family|system"}}} -->
<pre class="wp-block-verse" style="font-family:var(--wp--preset--font-family--system)">This is my styled verse</pre>
<!-- /wp:verse -->
<!-- wp:verse -->
<pre class="wp-block-verse">This is unstyled verse
</pre>
<!-- /wp:verse --> One thing that wasn't clear to me is how do I enable custom padding for the theme. If the theme doesn't have the support for custom padding this default value is ignored which feels like a good thing. I figured out that the theme needs to call: add_theme_support( 'custom-spacing' ); With that added, I was able to test how the test content behaves and it works perfectly fine. Feel free to merge this PR after the rebase. |
7c39a3a
to
2ba1a4c
Compare
@@ -342,6 +342,7 @@ These are the current color properties supported by blocks: | |||
| --- | --- | | |||
| Cover | Yes | | |||
| Group | Yes | | |||
| Verse | Yes | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! :)
I tried regenerating the fixtures again but it failed. Do I need to add a depreaction? |
Tried to re-run the tests but something went wrong, not sure what. Could you try to rebase from master and push again so the CI jobs are restarted? |
f85d969
to
0b9a7e4
Compare
I rebased but the tests failed again. |
Co-authored-by: O André <[email protected]>
Co-authored-by: O André <[email protected]>
0b9a7e4
to
ab44b59
Compare
Description
Adds support for custom padding to the Verse block. Also adds a default of 20px to match the padding that the editor adds. We might decide that to remove this padding.
How has this been tested?
Tested in TT1 Blocks in Chrome.
Screenshots
Types of changes
New feature
Checklist: