Skip to content

Commit

Permalink
Media & Text: Add spacing block supports (#43456)
Browse files Browse the repository at this point in the history
* Add spacing supports to Media & Text blocks.

* Add border-box styles.

* Fix merge issues and add back reference guide update.
  • Loading branch information
ndiego authored Aug 24, 2022
1 parent b36364a commit a7f1c92
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ Set media and words side-by-side for a richer layout. ([Source](https://github.c

- **Name:** core/media-text
- **Category:** media
- **Supports:** align (full, wide), anchor, color (background, gradients, link, text), typography (fontSize, lineHeight), ~~html~~
- **Supports:** align (full, wide), anchor, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~
- **Attributes:** align, focalPoint, href, imageFill, isStackedOnMobile, linkClass, linkDestination, linkTarget, mediaAlt, mediaId, mediaLink, mediaPosition, mediaSizeSlug, mediaType, mediaUrl, mediaWidth, rel, verticalAlignment

## Unsupported
Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/media-text/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@
"text": true
}
},
"spacing": {
"margin": true,
"padding": true
},
"typography": {
"fontSize": true,
"lineHeight": true,
Expand Down
2 changes: 2 additions & 0 deletions packages/block-library/src/media-text/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
display: grid;
grid-template-columns: 50% 1fr;
grid-template-rows: auto;
// This block has customizable padding, border-box makes that more predictable.
box-sizing: border-box;

&.has-media-on-the-right {
grid-template-columns: 1fr 50%;
Expand Down

0 comments on commit a7f1c92

Please sign in to comment.