From 91f25ad00433d797544bb44f967614664aeeaab8 Mon Sep 17 00:00:00 2001 From: Dominik George <dominik.george@teckids.org> Date: Mon, 18 Mar 2024 18:51:31 +0100 Subject: [PATCH] Simplify figcaption --- sass/_utils.scss | 22 ++-------------------- templates/blog/card.html | 4 +--- templates/blog/post.html | 4 +--- templates/shortcodes/further.html | 4 +--- 4 files changed, 5 insertions(+), 29 deletions(-) diff --git a/sass/_utils.scss b/sass/_utils.scss index 83de247d..d7d28d8b 100644 --- a/sass/_utils.scss +++ b/sass/_utils.scss @@ -3,27 +3,9 @@ height: 70%; } -.caption { +.card > .card-image figure.image > figcaption { position: absolute; - max-width: 100%; - opacity: 75%; - padding: 4px 4px 4px 4px; bottom: 0; -} - -.caption:hover>figcaption { - height: 100%; - text-wrap: wrap; -} - -.caption>figcaption { - display: block; - margin: 0 0 0 0!important; - padding-top: 3px; - padding-bottom: 3px; - position: relative; width: 100%; - text-overflow: ellipsis; - overflow: hidden; - text-wrap: nowrap; + opacity: 75%; } diff --git a/templates/blog/card.html b/templates/blog/card.html index eebd8b6c..1f482b3b 100644 --- a/templates/blog/card.html +++ b/templates/blog/card.html @@ -5,9 +5,7 @@ {% set image = resize_image(path="@/" ~ post.colocated_path ~ "/" ~ post.extra.depiction.image, width=800, height=600) -%} <img src="{{ image.url }}" alt="{{ post.extra.depiction.alt }}" /> {% if post.extra.depiction.credits %} - <div class="caption"> - <figcaption class="tag has-text-white has-background-black is-size-7 is-italic m-1">{{ post.extra.depiction.credits }}</figcaption> - </div> + <figcaption class="-1 has-text-white has-background-black is-size-7 is-italic">{{ post.extra.depiction.credits }}</figcaption> {% endif %} </figure> </a> diff --git a/templates/blog/post.html b/templates/blog/post.html index fe58c388..02943f81 100644 --- a/templates/blog/post.html +++ b/templates/blog/post.html @@ -15,9 +15,7 @@ {% set image = resize_image(path="@/" ~ post.colocated_path ~ "/" ~ post.extra.depiction.image, width=800, height=600) -%} <img src="{{ image.url }}" alt="{{ post.extra.depiction.alt }}" /> {% if post.extra.depiction.credits %} - <div class="caption"> - <figcaption class="tag has-text-white has-background-black is-size-7 is-italic m-1">{{ post.extra.depiction.credits }}</figcaption> - </div> + <figcaption class="p-1 has-text-white has-background-black is-size-7 is-italic">{{ post.extra.depiction.credits }}</figcaption> {% endif %} </figure> </div> diff --git a/templates/shortcodes/further.html b/templates/shortcodes/further.html index f7e186ea..238c8863 100644 --- a/templates/shortcodes/further.html +++ b/templates/shortcodes/further.html @@ -10,9 +10,7 @@ {% set image = resize_image(path="@/" ~ page.colocated_path ~ "/" ~ further.image, width=800, height=600) -%} <img src="{{image.url}}" alt="{{further.alt}}" /> {% if further.image.credits %} - <div class="caption"> - <figcaption class="tag has-text-white has-background-black is-size-7 is-italic m-1">{{ further.image.credits }}</figcaption> - </div> + <figcaption class="p-1 has-text-white has-background-black is-size-7 is-italic">{{ further.image.credits }}</figcaption> {% endif %} </figure> </a> -- GitLab