Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes #3723 Card title on image is red when the card is not clickable #3729

Merged
merged 3 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 3 additions & 16 deletions modules/custom/az_card/css/az-card-title-hover.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.card-with-link:hover .card-title {
.card-with-link:hover .card-title,
.card-title > a:hover {
text-decoration: underline;
}

Expand All @@ -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-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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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';
}
}

Expand Down
4 changes: 2 additions & 2 deletions modules/custom/az_card/templates/az-card.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<div class="card-img-overlay p-0 d-flex flex-column">
<{{ 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 %}
<a href="{{ link_url }}">{{ title }}</a>
<a href="{{ link_url }}" class="text-reset">{{ title }}</a>
{% else %}
{{ title }}
{% endif %}
Expand All @@ -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 %}
<a href="{{ link_url }}">{{ title }}</a>
<a href="{{ link_url }}" class="text-reset">{{ title }}</a>
{% else %}
{{ title }}
{% endif %}
Expand Down