Skip to content

Commit 85e377b

Browse files
committed
apply responsive image sizing globally to prevent mobile overflow
Graphviz diagrams are rendered/injected as plain `<img>` elements outside the banner container, and on mobile they were causing horizontal page overflow. The previous responsive image rule was scoped to `.banner img`, so those non-banner images could exceed viewport width and trigger horizontal scrolling. Move `max-width: 100%` and `height: auto` from `.banner img` to a global `img` rule. This sets a site-wide default policy that images should fit their container, while still preserving aspect ratio. This immediately fixes horizontal overflow for Graphviz images and also provides the same protection for future non-banner images by default.
1 parent 5462718 commit 85e377b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

assets/sass/main.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ body {
1414
padding-bottom: .1em;
1515
border-radius: 2em;
1616
}
17+
img {
18+
max-width: 100%;
19+
height: auto;
20+
}
1721
.banner {
1822
text-align: center;
1923
font-weight: bold;
20-
img {
21-
max-width: 100%;
22-
height: auto;
23-
}
2424
}
2525
big {
2626
font-size: 400%;

0 commit comments

Comments
 (0)