From 779fc7463273f29965c8a942f84189700a297f7a Mon Sep 17 00:00:00 2001 From: Kris Date: Wed, 18 Dec 2024 09:41:33 -0500 Subject: [PATCH] A11Y: show state change when post anchors are focused (#30334) --- app/assets/stylesheets/common/base/topic-post.scss | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/assets/stylesheets/common/base/topic-post.scss b/app/assets/stylesheets/common/base/topic-post.scss index dd244d30390..ab359613e94 100644 --- a/app/assets/stylesheets/common/base/topic-post.scss +++ b/app/assets/stylesheets/common/base/topic-post.scss @@ -114,6 +114,11 @@ opacity: 0; transition: opacity 0.25s; + &:focus-visible { + outline: 0; + opacity: 1; + } + &:before { content: svg-uri( '' @@ -126,6 +131,13 @@ } } + // the anchor icon is a CSS pseudo element set above + // so we can't change the color of the icon itself + // but we can change the color of the anchor text + &:has(a.anchor:focus-visible) { + color: var(--tertiary); + } + // show when hovering where icon should be // show when hovering header .discourse-no-touch & a.anchor:hover,