use a:focus-visible instead of a:focus to fix confusing click behavior

This commit is contained in:
James Fenn
2024-01-21 10:39:22 -05:00
parent 36a5b9cf50
commit c9dd821a60

View File

@@ -91,7 +91,7 @@
// click will follow the anchor href, so the "Copy link" // click will follow the anchor href, so the "Copy link"
// button should not be displayed // button should not be displayed
@supports selector(:has(*)) { @supports selector(:has(*)) {
:global(.heading-linked):has(a:hover, a:focus) { :global(.heading-linked):has(a:hover, a:focus-visible) {
.headingLink { .headingLink {
opacity: 0 !important; opacity: 0 !important;
} }
@@ -133,7 +133,7 @@
:global(.heading-linked):has(.headingLinkContainer:hover) { :global(.heading-linked):has(.headingLinkContainer:hover) {
// The underline should not be applied if an inner <a> is focused // The underline should not be applied if an inner <a> is focused
// as clicking will follow the link, not interact with the heading // as clicking will follow the link, not interact with the heading
&:not(:has(a:hover, a:focus)) { &:not(:has(a:hover, a:focus-visible)) {
text-decoration: underline; text-decoration: underline;
} }
} }