Skip to content

Commit

Permalink
Add 16/9 aspect ratio for video/iframe to default CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Jan 14, 2025
1 parent 8b53e14 commit eea504a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions eleventy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export default async function(eleventyConfig) {

// widths: ["auto"],

failOnError: false,
htmlOptions: {
imgAttributes: {
// e.g. <img loading decoding> assigned on the HTML tag will override these values.
Expand Down
10 changes: 7 additions & 3 deletions public/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ body {
}

/* Fluid images via https://www.zachleat.com/web/fluid-images/ */
img,
video,
iframe {
img{
max-width: 100%;
}
img[width][height] {
Expand All @@ -85,6 +83,12 @@ img[src$=".svg"] {
height: auto;
max-width: none;
}
video,
iframe {
max-width: 100%;
height: auto;
aspect-ratio: 16/9;
}

p:last-child {
margin-bottom: 0;
Expand Down

0 comments on commit eea504a

Please sign in to comment.