summaryrefslogtreecommitdiff
path: root/assets/static/css/style.css
diff options
context:
space:
mode:
authorDennis Fink2026-08-08 19:32:47 +0200
committerDennis Fink2026-08-08 19:32:47 +0200
commit1af817249d115ff7013d3ab1a30ea145e30924c7 (patch)
treeabaccd3582453e702754da0f111bf0a75002f14a /assets/static/css/style.css
parent0d0b6cf226c5a06c265de540ca0c2997e7ed2b06 (diff)
downloaddennisfink.me-1af817249d115ff7013d3ab1a30ea145e30924c7.tar.gz
dennisfink.me-1af817249d115ff7013d3ab1a30ea145e30924c7.zip
Add aspect-ratio-aware image galleries
This adds a project-local gallery plugin that builds deterministic rectangular image layouts from attachment aspect ratios, with both in-process and disk-backed layout caching. It also adds gallery flow blocks, templates, and CSS so posts can include responsive galleries with lazy-loaded images, configurable gaps, target ratios, and the existing breakout/centering utilities.
Diffstat (limited to '')
-rw-r--r--assets/static/css/style.css57
1 files changed, 56 insertions, 1 deletions
diff --git a/assets/static/css/style.css b/assets/static/css/style.css
index a8fe9b7..fb12054 100644
--- a/assets/static/css/style.css
+++ b/assets/static/css/style.css
@@ -847,7 +847,7 @@ img.round {
border-radius: 100%;
}
-:is(img, figure) {
+:is(img, figure, .gallery) {
&.center {
display: block;
margin-inline: auto;
@@ -970,3 +970,58 @@ article::after,
.missing-publication-date-warning > dt {
color: var(--foreground);
}
+
+.gallery {
+ margin-block: 1rem;
+
+ [data-direction] {
+ display: flex;
+ gap: var(--gap);
+ width: 100%;
+ }
+
+ [data-direction="row"] {
+ align-items: flex-start;
+ flex-direction: row;
+
+ & > div {
+ flex: none;
+ min-width: 0;
+ width: var(--width);
+ }
+ }
+
+ [data-direction="column"] {
+ flex-direction: column;
+
+ & > div {
+ width: 100%;
+ }
+ }
+
+ img {
+ display: block;
+ width: 100%;
+ height: auto;
+ border-radius: var(--default-border-radius);
+ }
+
+ @media (max-width: 500px) {
+ [data-direction] {
+ flex-direction: column;
+ width: 100%;
+ }
+
+ [data-direction] > div {
+ flex: none;
+ min-width: 0;
+ width: 100%;
+ }
+
+ img {
+ height: auto;
+ max-width: 100%;
+ width: 100%;
+ }
+ }
+}