Skip to content

Commit

Permalink
Add styles to ensure iframes are responsive (#1267)
Browse files Browse the repository at this point in the history
Ensures iframes are responsive.

This problem doesn't affect the Playground `iframe` embeds. Based on my
tests, the fix suggested here doesn't have a negative impact on them.

## What problem is it solving?

The video added in [PR
#530](#530)
creates a horizontal overflow in small screens.

This isn't an isolated issue (it can be seen [on this page,
too](https://wordpress.github.io/wordpress-playground/start-using)),
which is why I thought it'll be good to add some default “defensive
styles” to the documentation site.
 
## How is the problem addressed?

By adding the following to the Docusaurus CSS:

```css
iframe {
  aspect-ratio: 16/9;
  max-width: 100%;
  display: block;
  height: auto;
}
```

## Testing Instructions
  • Loading branch information
ironnysh authored Apr 19, 2024
1 parent 0a0f03f commit 563775b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/docs/site/src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,10 @@ li.footer__item a:hover {
.footerLogoLink_mPrW {
opacity: 1 !important;
}

iframe {
aspect-ratio: 16/9;
max-width: 100%;
display: block;
height: auto;
}

0 comments on commit 563775b

Please sign in to comment.