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

Verse Block: Adds support for custom padding #27341

Merged
merged 6 commits into from
Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/designers-developers/developers/themes/theme-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ These are the current color properties supported by blocks:
| --- | --- |
| Cover | Yes |
| Group | Yes |
| Verse | Yes |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! :)


#### Typography Properties

Expand Down
17 changes: 16 additions & 1 deletion packages/block-library/src/verse/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,27 @@
"default": "",
"__unstablePreserveWhiteSpace": true
},
"style": {
"default": {
"spacing": {
"padding": {
"top": 20,
"right": 20,
"bottom": 20,
"left": 20
}
}
}
},
"textAlign": {
"type": "string"
}
},
"supports": {
"anchor": true,
"__experimentalFontFamily": true
"__experimentalFontFamily": true,
"spacing": {
"padding": true
}
}
}
1 change: 0 additions & 1 deletion packages/block-library/src/verse/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ pre.wp-block-verse {
color: $gray-900;
white-space: nowrap;
font-size: inherit;
padding: 1em;
overflow: auto;
}
6 changes: 3 additions & 3 deletions packages/e2e-tests/fixtures/blocks/core__verse.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<!-- wp:core/verse -->
<pre class="wp-block-verse">A <em>verse</em>…<br>And more!</pre>
<!-- /wp:core/verse -->
<!-- wp:verse -->
<pre class="wp-block-verse" style="padding-bottom:20px;padding-left:20px;padding-right:20px;padding-top:20px">A <em>verse</em>…<br>And more!</pre>
<!-- /wp:verse -->
14 changes: 12 additions & 2 deletions packages/e2e-tests/fixtures/blocks/core__verse.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,19 @@
"name": "core/verse",
"isValid": true,
"attributes": {
"content": "A <em>verse</em>…<br>And more!"
"content": "A <em>verse</em>…<br>And more!",
"style": {
"spacing": {
"padding": {
"top": 20,
"right": 20,
"bottom": 20,
"left": 20
}
}
}
},
"innerBlocks": [],
"originalContent": "<pre class=\"wp-block-verse\">A <em>verse</em>…<br>And more!</pre>"
"originalContent": "<pre class=\"wp-block-verse\" style=\"padding-bottom:20px;padding-left:20px;padding-right:20px;padding-top:20px\">A <em>verse</em>…<br>And more!</pre>"
}
]
4 changes: 2 additions & 2 deletions packages/e2e-tests/fixtures/blocks/core__verse.parsed.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"blockName": "core/verse",
"attrs": {},
"innerBlocks": [],
"innerHTML": "\n<pre class=\"wp-block-verse\">A <em>verse</em>…<br>And more!</pre>\n",
"innerHTML": "\n<pre class=\"wp-block-verse\" style=\"padding-bottom:20px;padding-left:20px;padding-right:20px;padding-top:20px\">A <em>verse</em>…<br>And more!</pre>\n",
"innerContent": [
"\n<pre class=\"wp-block-verse\">A <em>verse</em>…<br>And more!</pre>\n"
"\n<pre class=\"wp-block-verse\" style=\"padding-bottom:20px;padding-left:20px;padding-right:20px;padding-top:20px\">A <em>verse</em>…<br>And more!</pre>\n"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<!-- wp:verse -->
<pre class="wp-block-verse">A <em>verse</em>…<br>And more!</pre>
<pre class="wp-block-verse" style="padding-bottom:20px;padding-left:20px;padding-right:20px;padding-top:20px">A <em>verse</em>…<br>And more!</pre>
<!-- /wp:verse -->