From 0abdca3d8e6c16553bb4ad869826f177aaab0943 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Wed, 7 Aug 2024 16:29:41 +0200 Subject: [PATCH] refactoring links icon handling depending on global context --- resources/css/base/links.css | 79 ++++++++++++++++++++++ resources/css/editor-content/gutenberg.css | 4 +- 2 files changed, 81 insertions(+), 2 deletions(-) create mode 100644 resources/css/base/links.css diff --git a/resources/css/base/links.css b/resources/css/base/links.css new file mode 100644 index 0000000..ea8584d --- /dev/null +++ b/resources/css/base/links.css @@ -0,0 +1,79 @@ +:root :where(a:where(:not(.wp-element-button))) { + text-decoration: unset; +} +/* EXTERNAL LINKS IN NEW TAB */ + +a:not( + .cta--secondary, + .wp-block-button__link, + .cta, + .homegrade-blocks-lien-chapitre__cta, + .breadcrumbs_navigation a, + .share-link, + .previous-next-posts__link + ) { + /* &[rel='noreferrer noopener'] { + &:after { + @apply ml-2 inline-block; + content: url('../resources/img/graphic-assets/icone-external-link-purple.svg'); + transform: translateY(1px); + } + } */ +} + +main + a[target='_blank']:not(.cta--primary, .cta--button, .wp-block-button__link):not( + [href*='homegrade\.local'] + ):not([href*='homegrade\.brussels']) { + @apply inline-flex items-center; + @apply px-2 py-1; + @apply text-primary underline font-bold relative; + + &:after { + @apply ml-2 inline-block; + /* content: url('../resources/img/graphic-assets/icone-external-link-purple.svg'); */ + /* transform: translateY(-3px); */ + + html[lang='fr-FR'] & { + content: "S'ouvre dans un nouvel onglet "; + } + html[lang='nl-NL'] & { + content: 'Downloaden'; + } + @apply w-4 h-4 inline-block ml-2 bg-center bg-no-repeat; + font-size: 0 !important; + background-image: url('../resources/img/graphic-assets/icone-external-link-black.svg'); + } + &:hover { + @apply rounded-md; + background: rgba(239, 239, 239); + } +} + +/* INTERNAL LINKS TO A PDF */ +a[href$='.pdf']:is(a[href*='homegrade\.local'], a[href*='homegrade\.brussels']):not( + .cta, + .brochure-link-format, + + ) { + @apply inline-flex items-center; + &:after { + html[lang='fr-FR'] & { + content: 'Télécharger'; + } + html[lang='nl-NL'] & { + content: 'Downloaden'; + } + @apply w-4 h-4 inline-block ml-2 bg-center bg-no-repeat; + font-size: 0 !important; + background-image: url('../resources/img/graphic-assets/icon_brochure_download.svg'); + } +} + +.external-link { + &:after { + @apply ml-2 inline-block; + content: url('../resources/img/graphic-assets/icone-external-link-purple.svg'); + transform: translateY(1px); + } +} diff --git a/resources/css/editor-content/gutenberg.css b/resources/css/editor-content/gutenberg.css index c28ac04..362e250 100644 --- a/resources/css/editor-content/gutenberg.css +++ b/resources/css/editor-content/gutenberg.css @@ -147,7 +147,7 @@ article > *:not(.entry-content, .chapter-header-block), margin-top: 9px; } - a:not( + /* a:not( .cta--secondary, .wp-block-button__link, .cta, @@ -171,7 +171,7 @@ article > *:not(.entry-content, .chapter-header-block), transform: translateY(1px); } } - } + } */ p + ol, p + ul {