From 7af08bb4ce076a4b10de72c4c1fcc038fa757d4c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Arnaud=20Gu=C3=A9ras?= Date: Wed, 20 Nov 2024 16:27:44 +0100 Subject: [PATCH] fix cards and mobile nav MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Arnaud Guéras --- stories/molecules/Card.stories.js | 4 ++-- themes/xen-project/assets/css/molecules/buttons.scss | 4 ++-- themes/xen-project/assets/css/molecules/card.scss | 9 ++++++++- themes/xen-project/layouts/partials/card.html | 4 ++-- themes/xen-project/layouts/partials/latest-news.html | 4 ++-- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/stories/molecules/Card.stories.js b/stories/molecules/Card.stories.js index 4e245e8..1015477 100644 --- a/stories/molecules/Card.stories.js +++ b/stories/molecules/Card.stories.js @@ -46,7 +46,7 @@ export const Card = { ${["", "card--news", "card--bg"].map( (cls) => html`
- +
Conversation Card ${cls.replace(/card--/g, "")}
aug, 5th 2024
@@ -62,7 +62,7 @@ export const Card = { by John Doe
- Join Join diff --git a/themes/xen-project/assets/css/molecules/buttons.scss b/themes/xen-project/assets/css/molecules/buttons.scss index 6df6e3f..65e8c81 100644 --- a/themes/xen-project/assets/css/molecules/buttons.scss +++ b/themes/xen-project/assets/css/molecules/buttons.scss @@ -70,7 +70,7 @@ &:hover, &.hover, - body .card:hover & { + body .card:not(:has(.card__actions a:nth-child(2))):hover & { --color-primary: var(--color-hover); --icon-left: 0.3em; } @@ -140,7 +140,7 @@ } &:hover::before, - body .card:hover &::before { + body .card:not(:has(.card__actions a:nth-child(2))):hover &::before { transform: scaleX(1); } } diff --git a/themes/xen-project/assets/css/molecules/card.scss b/themes/xen-project/assets/css/molecules/card.scss index ee404a7..4277bf7 100644 --- a/themes/xen-project/assets/css/molecules/card.scss +++ b/themes/xen-project/assets/css/molecules/card.scss @@ -23,7 +23,7 @@ flex-direction: column; gap: 10px; position: relative; - cursor: pointer; + //cursor: pointer; img { max-width: 100%; @@ -62,6 +62,13 @@ z-index: 1; } + &:has(.card__actions a:nth-child(2)) { + .card__link { + display: none; + } + /* some other styles are applied to the "card__actions a" in buttons.scss file */ + } + /* Pour que les autres liens restent cliquables */ &__tags a, &__author a, diff --git a/themes/xen-project/layouts/partials/card.html b/themes/xen-project/layouts/partials/card.html index 3794932..1f66b3f 100644 --- a/themes/xen-project/layouts/partials/card.html +++ b/themes/xen-project/layouts/partials/card.html @@ -3,7 +3,7 @@
- + {{ if .titleLevel }} {{ .title | safeHTML }} {{ else }} @@ -23,7 +23,7 @@ {{ .linkText | default $defaultLinkText }} {{ if .secondaryLink }} - + {{ .secondaryLinkText | default $defaultLinkText }} diff --git a/themes/xen-project/layouts/partials/latest-news.html b/themes/xen-project/layouts/partials/latest-news.html index 98f6834..95bf0b0 100644 --- a/themes/xen-project/layouts/partials/latest-news.html +++ b/themes/xen-project/layouts/partials/latest-news.html @@ -7,7 +7,7 @@