From e8c08ee37600ed3ad161f0fca84d362c14fe6b71 Mon Sep 17 00:00:00 2001 From: Brian Berndt Date: Tue, 17 Sep 2024 14:48:39 -0700 Subject: [PATCH 1/3] Update title styling for Cards paragraphs --- .../az_card/css/az-card-title-hover.css | 19 +++---------------- .../FieldFormatter/AZCardDefaultFormatter.php | 2 +- .../az_card/templates/az-card.html.twig | 2 +- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/modules/custom/az_card/css/az-card-title-hover.css b/modules/custom/az_card/css/az-card-title-hover.css index ca654eba8a..c1987d2f5d 100644 --- a/modules/custom/az_card/css/az-card-title-hover.css +++ b/modules/custom/az_card/css/az-card-title-hover.css @@ -1,4 +1,5 @@ -.card-with-link:hover .card-title { +.card-with-link:hover .card-title, +.card-img-overlay > .card-title > a:hover { text-decoration: underline; } @@ -7,20 +8,6 @@ transition: ease .25s; } -h2.card-title>a, -h3.card-title>a, -h4.card-title>a, -h5.card-title>a, -h6.card-title>a { - color: inherit; +.card-img-overlay > .card-title > a { text-decoration: inherit; - font-weight: inherit; -} - -h2.card-title>a:hover, -h3.card-title>a:hover, -h4.card-title>a:hover, -h5.card-title>a:hover, -h6.card-title>a:hover { - text-decoration: underline; } diff --git a/modules/custom/az_card/src/Plugin/Field/FieldFormatter/AZCardDefaultFormatter.php b/modules/custom/az_card/src/Plugin/Field/FieldFormatter/AZCardDefaultFormatter.php index d72a4fd14f..c759d6e7b2 100644 --- a/modules/custom/az_card/src/Plugin/Field/FieldFormatter/AZCardDefaultFormatter.php +++ b/modules/custom/az_card/src/Plugin/Field/FieldFormatter/AZCardDefaultFormatter.php @@ -146,6 +146,7 @@ public function viewElements(FieldItemListInterface $items, $langcode) { $link_render_array['#attributes']['class'][] = 'az-card-no-follow'; $attached['library'][] = 'az_card/az_card_no_follow'; } + $attached['library'][] = 'az_card/az_card_title_hover'; } // Title alignment. @@ -188,7 +189,6 @@ public function viewElements(FieldItemListInterface $items, $langcode) { $card_classes .= ' shadow'; if ($item->link_uri) { $card_classes .= ' card-with-link'; - $attached['library'][] = 'az_card/az_card_title_hover'; } } diff --git a/modules/custom/az_card/templates/az-card.html.twig b/modules/custom/az_card/templates/az-card.html.twig index b3f26e19ef..efabb52339 100644 --- a/modules/custom/az_card/templates/az-card.html.twig +++ b/modules/custom/az_card/templates/az-card.html.twig @@ -29,7 +29,7 @@
<{{ title_level }} class="bold mt-auto card-title bg-gradient-black text-white mb-0 p-card pt-8 {{ title_alignment }} {{ title_display }}"> {% if link|render %} - {{ title }} + {{ title }} {% else %} {{ title }} {% endif %} From 1079159b12626038e352a5d9f58e1d291b2205f0 Mon Sep 17 00:00:00 2001 From: Brian Berndt Date: Tue, 17 Sep 2024 15:35:44 -0700 Subject: [PATCH 2/3] Fix color of linked title within cards --- modules/custom/az_card/templates/az-card.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/custom/az_card/templates/az-card.html.twig b/modules/custom/az_card/templates/az-card.html.twig index efabb52339..fe4bbefcd3 100644 --- a/modules/custom/az_card/templates/az-card.html.twig +++ b/modules/custom/az_card/templates/az-card.html.twig @@ -29,7 +29,7 @@
<{{ title_level }} class="bold mt-auto card-title bg-gradient-black text-white mb-0 p-card pt-8 {{ title_alignment }} {{ title_display }}"> {% if link|render %} - {{ title }} + {{ title }} {% else %} {{ title }} {% endif %} @@ -49,7 +49,7 @@ {% if title and title_style == 'default' %} <{{ title_level }} class="bold mt-0 mb-3 card-title {{ title_alignment }} {{ title_display }}"> {% if link|render %} - {{ title }} + {{ title }} {% else %} {{ title }} {% endif %} From f1ec006020ff60379db4216db9958a35cb1bdff5 Mon Sep 17 00:00:00 2001 From: Brian Berndt Date: Tue, 17 Sep 2024 15:37:17 -0700 Subject: [PATCH 3/3] Update styling for title within card fix --- modules/custom/az_card/css/az-card-title-hover.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/custom/az_card/css/az-card-title-hover.css b/modules/custom/az_card/css/az-card-title-hover.css index c1987d2f5d..02e3072759 100644 --- a/modules/custom/az_card/css/az-card-title-hover.css +++ b/modules/custom/az_card/css/az-card-title-hover.css @@ -1,5 +1,5 @@ .card-with-link:hover .card-title, -.card-img-overlay > .card-title > a:hover { +.card-title > a:hover { text-decoration: underline; } @@ -8,6 +8,6 @@ transition: ease .25s; } -.card-img-overlay > .card-title > a { +.card-title > a { text-decoration: inherit; }