Skip to content

Commit 418a8f6

Browse files
jasmussenyouknowriad
authored andcommitted
Try to add a min-width to embeds. (#13590)
* Try to add a min-width to embeds. Embeds are increasingly responsive (as they should be). This branch is very much a "try" branch, in that it simply zeroes out the minimum width of embeds to make the Amazon book embed be responsive. This allows us to create a nice book recommendation grid like this. However, Amazon themselves include a "Share" modal inside, which is 320px wide and is `opacity: 0;` (until invoked) instead of `display: none;`. So even though the embed itself is smart enough to not even show the Share button when there isn't room, that zero opacity share sheet still causes a horizontal scrollbar, which due to the sandboxing of iframes, we cannot fix. So this PR is more of a discussion point: what can we do with these embeds? I'm not sure we can do that much. Notably Instagram widgets can't be smaller than 326px, so we can't do this in a blanket way either, or it'll just mess up other embeds. What are your thoughts? * Make min-width not affect placeholders. * Change to suggested fix.
1 parent f3bf1ba commit 418a8f6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/block-library/src/embed/editor.scss

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
// Instagram widgets have a min-width of 326px, so go a bit beyond that.
1010
@include break-small() {
1111
min-width: 360px;
12+
13+
// The placeholder should not have this min-width.
14+
&.components-placeholder {
15+
min-width: 0;
16+
}
1217
}
1318

1419
&.is-loading {

0 commit comments

Comments
 (0)