From 0602108f56f8dd1ce51aea37681b2ee531e83baf Mon Sep 17 00:00:00 2001 From: James Panther <4462786+jpanther@users.noreply.github.com> Date: Thu, 3 Feb 2022 11:07:12 +1100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Adopt=20Tailwind=20hover-g?= =?UTF-8?q?roup=20classes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/css/compiled/main.css | 81 ++++++++------------ assets/css/main.css | 20 ----- layouts/_default/_markup/render-heading.html | 2 +- layouts/partials/article-pagination.html | 20 ++--- 4 files changed, 46 insertions(+), 77 deletions(-) diff --git a/assets/css/compiled/main.css b/assets/css/compiled/main.css index 8a7654aa..32b5689f 100644 --- a/assets/css/compiled/main.css +++ b/assets/css/compiled/main.css @@ -921,48 +921,6 @@ body a, body button { display: none; } -/* Heading anchors */ - -.prose .heading-anchor:hover { - background-color: transparent !important; - --tw-text-opacity: 1 !important; - color: rgba(var(--color-primary-500), var(--tw-text-opacity)) !important; - -webkit-text-decoration-line: underline !important; - text-decoration-line: underline !important; -} - -.prose .heading-anchor:hover, .prose .heading-anchor:focus, .prose h2:hover > .heading-anchor, .prose h3:hover > .heading-anchor, .prose h4:hover > .heading-anchor { - --tw-text-opacity: 1; - color: rgba(var(--color-primary-200), var(--tw-text-opacity)); - -webkit-text-decoration-line: none; - text-decoration-line: none; - opacity: 1; -} - -.dark .prose .heading-anchor:hover, .dark .prose .heading-anchor:focus, .dark .prose h2:hover > .heading-anchor, .dark .prose h3:hover > .heading-anchor, .dark .prose h4:hover > .heading-anchor { - --tw-text-opacity: 1; - color: rgba(var(--color-neutral-700), var(--tw-text-opacity)); -} - -/* Article pagination */ - -.article-pagination a:hover .article-pagination-title { - -webkit-text-decoration-line: underline; - text-decoration-line: underline; - -webkit-text-decoration-color: rgb(var(--color-primary-500)); - text-decoration-color: rgb(var(--color-primary-500)); -} - -.article-pagination a:hover .article-pagination-direction { - --tw-text-opacity: 1; - color: rgba(var(--color-primary-600), var(--tw-text-opacity)); -} - -.dark .article-pagination a:hover .article-pagination-direction { - --tw-text-opacity: 1; - color: rgba(var(--color-primary-400), var(--tw-text-opacity)); -} - /* RTL support */ [dir="rtl"] .prose blockquote { @@ -2198,11 +2156,6 @@ body a, body button { text-decoration-line: none !important; } -.no-underline { - -webkit-text-decoration-line: none; - text-decoration-line: none; -} - .opacity-0 { opacity: 0; } @@ -2330,6 +2283,30 @@ body a, body button { outline-color: transparent; } +.group:hover .group-hover\:text-primary-600 { + --tw-text-opacity: 1; + color: rgba(var(--color-primary-600), var(--tw-text-opacity)); +} + +.group:hover .group-hover\:text-primary-300 { + --tw-text-opacity: 1; + color: rgba(var(--color-primary-300), var(--tw-text-opacity)); +} + +.group:hover .group-hover\:underline { + -webkit-text-decoration-line: underline; + text-decoration-line: underline; +} + +.group:hover .group-hover\:decoration-primary-500 { + -webkit-text-decoration-color: rgb(var(--color-primary-500)); + text-decoration-color: rgb(var(--color-primary-500)); +} + +.group:hover .group-hover\:opacity-100 { + opacity: 1; +} + [dir="ltr"] .ltr\:right-0 { right: 0px; } @@ -2614,6 +2591,16 @@ body a, body button { background-color: rgba(var(--color-primary-900), var(--tw-bg-opacity)); } +.dark .group:hover .dark\:group-hover\:text-primary-400 { + --tw-text-opacity: 1; + color: rgba(var(--color-primary-400), var(--tw-text-opacity)); +} + +.dark .group:hover .dark\:group-hover\:text-neutral-700 { + --tw-text-opacity: 1; + color: rgba(var(--color-neutral-700), var(--tw-text-opacity)); +} + @media (min-width: 640px) { .sm\:mb-0 { margin-bottom: 0px; diff --git a/assets/css/main.css b/assets/css/main.css index 0c4e9314..e9e617f7 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -21,26 +21,6 @@ body button { @apply hidden; } -/* Heading anchors */ -.prose .heading-anchor:hover { - @apply underline bg-transparent text-primary-500 !important; -} -.prose .heading-anchor:hover, -.prose .heading-anchor:focus, -.prose h2:hover > .heading-anchor, -.prose h3:hover > .heading-anchor, -.prose h4:hover > .heading-anchor { - @apply no-underline opacity-100 text-primary-200 dark:text-neutral-700; -} - -/* Article pagination */ -.article-pagination a:hover .article-pagination-title { - @apply underline decoration-primary-500; -} -.article-pagination a:hover .article-pagination-direction { - @apply text-primary-600 dark:text-primary-400; -} - /* RTL support */ .prose blockquote { @apply rtl:pr-4 rtl:border-l-0 rtl:border-r-4; diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html index 6c788f73..7ebc0452 100644 --- a/layouts/_default/_markup/render-heading.html +++ b/layouts/_default/_markup/render-heading.html @@ -1 +1 @@ -{{ .Text | safeHTML }} {{ if .Page.Params.showHeadingAnchors | default (.Page.Site.Params.article.showHeadingAnchors | default true) }}#{{ end }} +{{ .Text | safeHTML }} {{ if .Page.Params.showHeadingAnchors | default (.Page.Site.Params.article.showHeadingAnchors | default true) }}#{{ end }} diff --git a/layouts/partials/article-pagination.html b/layouts/partials/article-pagination.html index 85b4d22d..f5eae275 100644 --- a/layouts/partials/article-pagination.html +++ b/layouts/partials/article-pagination.html @@ -6,22 +6,23 @@ {{ $next = .PrevInSection }} {{ $prev = .NextInSection }} {{ end }} -
+