Skip to content
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
2 changes: 1 addition & 1 deletion docs/reference-guides/core-blocks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ Add a block that displays content pulled from other sites, like Twitter or YouTu

- **Name:** [core/embed](https://developer.wordpress.org/block-editor/reference-guides/core-blocks/core-blocks-embed/core-block-embed/)
- **Category:** [embed](https://developer.wordpress.org/block-editor/reference-guides/core-blocks/core-blocks-embed/)
- **Supports:** align, anchor, interactivity (clientNavigation), spacing (margin, padding)
- **Supports:** align, anchor, dimensions (minHeight, minWidth), interactivity (clientNavigation), spacing (margin, padding)
- **Attributes:** allowResponsive, caption, previewable, providerNameSlug, responsive, type, url

## File
Expand Down
3 changes: 3 additions & 0 deletions packages/block-library/src/embed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ _Defined via the [`supports`](https://developer.wordpress.org/block-editor/refer

- [`anchor`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#anchor): `true`
- [`align`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#align): `true`
- [`dimensions`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#dimensions):
- `minHeight`: `true`
- `minWidth`: `true`
- [`spacing`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#spacing):
- `margin`: `true`
- `padding`: `true`
Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/embed/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
"supports": {
"anchor": true,
"align": true,
"dimensions": {
"minHeight": true,
"minWidth": true
},
"spacing": {
"margin": true,
"padding": true
Expand Down
8 changes: 7 additions & 1 deletion packages/block-library/src/embed/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,20 @@
}

// Supply a min-width when inside a cover block, to prevent it from collapsing.
.wp-block-cover .wp-block-embed {
// :root :where() matches Global Styles specificity so a minimum set there can
// win, since block library styles load first.
:root :where(.wp-block-cover .wp-block-embed) {
min-width: 320px;
min-height: 240px;
}

// Allow embeds to grow and shrink inside flex group blocks (Stack/Row), preventing collapse while fitting available space.
.wp-block-group.is-layout-flex .wp-block-embed {
flex: 1 1 0%;
}

// Lowered like the cover minimums above.
:root :where(.wp-block-group.is-layout-flex .wp-block-embed) {
min-width: 0;
}

Expand Down
Loading