Skip to content

Commit c1d791a

Browse files
committed
Make images more responsive
More info can be found here: https://www.zachleat.com/web/fluid-images/
1 parent 092d0d8 commit c1d791a

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

assets.css

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,33 @@
22
* Restrict sizing to the page width in all browsers (opinionated).
33
*/
44

5-
:where(iframe, img, input, video, select, textarea) {
5+
:where(iframe, input, video, select, textarea) {
66
height: auto;
77
max-width: 100%;
88
}
9+
10+
/**
11+
* Do not stretch image or grow bigger than parent
12+
*/
13+
14+
:where(img) {
15+
max-width: 100%;
16+
}
17+
18+
/**
19+
* Preserve aspect ratio
20+
*/
21+
22+
:where(img[width][height]) {
23+
height: auto;
24+
}
25+
26+
/**
27+
* Let SVG scale without boundaries
28+
*/
29+
30+
:where(img[src$=".svg"]) {
31+
width: 100%;
32+
height: auto;
33+
max-width: none;
34+
}

0 commit comments

Comments
 (0)