From 366a160528b0950c17cb9bef608463dc92932421 Mon Sep 17 00:00:00 2001 From: Nicholas Ruffing Date: Sat, 9 Dec 2023 11:53:57 -0500 Subject: [PATCH] fix: use headerLink from markdown-it-anchor for better accessibility (vuepress#1363) --- .../src/client/styles/layout.scss | 2 +- .../src/client/styles/normalize.scss | 25 ++----------------- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/themes/theme-default/src/client/styles/layout.scss b/themes/theme-default/src/client/styles/layout.scss index 9aa6a6852d..2a2572539b 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:hover { + a:not(.anchor-header):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 ed818dcb7a..ef0883b095 100644 --- a/themes/theme-default/src/client/styles/normalize.scss +++ b/themes/theme-default/src/client/styles/normalize.scss @@ -93,7 +93,8 @@ h6 { } &:hover .header-anchor { - opacity: 1; + color: var(--c-text-accent); + text-decoration: none; } } @@ -125,28 +126,6 @@ h6 { } a { - &.header-anchor { - font-size: 0.85em; - float: left; - margin-left: -0.87em; - padding-right: 0.23em; - margin-top: 0.125em; - opacity: 0; - user-select: none; - - @media print { - display: none; - } - - &:hover { - text-decoration: none; - } - - &:focus-visible { - opacity: 1; - } - } - @media print { &[href^="http://"], &[href^="https://"]