From 046ea1cff8c1f2f40bdded2ff713314d78f59501 Mon Sep 17 00:00:00 2001 From: "Mr.Hope" Date: Thu, 25 Jan 2024 01:31:46 +0800 Subject: [PATCH] fix(theme-default): fix new anchor style --- .../src/client/styles/layout.scss | 2 +- .../src/client/styles/normalize.scss | 24 +++++++++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/themes/theme-default/src/client/styles/layout.scss b/themes/theme-default/src/client/styles/layout.scss index 2a2572539b..6549844325 100644 --- a/themes/theme-default/src/client/styles/layout.scss +++ b/themes/theme-default/src/client/styles/layout.scss @@ -126,7 +126,7 @@ } .theme-default-content { - a:not(.anchor-header):hover { + a:not(.header-anchor):hover { text-decoration: underline; } diff --git a/themes/theme-default/src/client/styles/normalize.scss b/themes/theme-default/src/client/styles/normalize.scss index ef0883b095..cfab75483b 100644 --- a/themes/theme-default/src/client/styles/normalize.scss +++ b/themes/theme-default/src/client/styles/normalize.scss @@ -92,9 +92,29 @@ h6 { outline: none; } - &:hover .header-anchor { - color: var(--c-text-accent); + .header-anchor { + color: inherit; text-decoration: none; + position: relative; + + &:hover ::before { + content: '¶'; + position: absolute; + left: -0.75em; + color: var(--c-brand); + } + + &:focus-visible { + outline: none; + + &::before { + content: '¶'; + position: absolute; + left: -0.75em; + color: var(--c-brand); + outline: auto; + } + } } }