From: Vladimír Vondruš Date: Mon, 11 Sep 2017 11:26:45 +0000 (+0200) Subject: css: make it image grid more flexible. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=aaa0db388598c8d53d12e4e2e05d7a3123ccbf8b;p=blog.git css: make it image grid more flexible. It's now possible to omit the link, omit the caption or both. --- diff --git a/css/m-components.css b/css/m-components.css index c699f094..b9dd3242 100644 --- a/css/m-components.css +++ b/css/m-components.css @@ -896,7 +896,10 @@ figure.m-figure.m-fullwidth img { position: relative; margin: 0; } -.m-imagegrid > figure > a > div { +.m-imagegrid > figure > div, +.m-imagegrid > figure > figcaption, +.m-imagegrid > figure > a > div, +.m-imagegrid > figure > a > figcaption { position: absolute; top: 0; left: 0; @@ -906,23 +909,31 @@ figure.m-figure.m-fullwidth img { border-style: solid; border-width: 0.25rem; padding: 0.5rem; +} +.m-imagegrid > figure > figcaption, +.m-imagegrid > figure > a > figcaption { color: transparent; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.75rem; } -.m-imagegrid > figure > a > div::before { +.m-imagegrid > figure > div::before, +.m-imagegrid > figure > figcaption::before, +.m-imagegrid > figure > a > div::before, +.m-imagegrid > figure > a > figcaption::before { content: ''; display: inline-block; height: 100%; vertical-align: bottom; width: 0; } -.m-imagegrid > figure:hover > a > div { +.m-imagegrid > figure:hover > figcaption, +.m-imagegrid > figure:hover > a > figcaption { background: linear-gradient(transparent 0%, transparent 75%, rgba(0, 0, 0, 0.85) 100%); color: #ffffff; } +.m-imagegrid > figure > img, .m-imagegrid > figure > a > img { width: 100%; height: 100%;