From 567f9caf75e1cc1ad131e6c4fb832c553531edb0 Mon Sep 17 00:00:00 2001 From: Kris Date: Mon, 24 May 2021 04:10:01 -0400 Subject: [PATCH] A11Y: Fix post control and user-menu focus styles (#13118) --- .../stylesheets/common/base/menu-panel.scss | 15 +++++++++++++-- .../stylesheets/common/components/buttons.scss | 5 ++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/assets/stylesheets/common/base/menu-panel.scss b/app/assets/stylesheets/common/base/menu-panel.scss index 92b6058f7ec..b94e1c03f11 100644 --- a/app/assets/stylesheets/common/base/menu-panel.scss +++ b/app/assets/stylesheets/common/base/menu-panel.scss @@ -284,12 +284,23 @@ } } - &:hover, - &:focus { + &:hover { background-color: var(--highlight-medium); outline: none; } + &:focus-within { + background: var(--highlight-medium); + a { + // we don't need the link focus because we're styling the parent + outline: 0; + } + .btn-flat:focus { + // undo default btn-flat style + background: transparent; + } + } + a { display: flex; margin: 0.25em; diff --git a/app/assets/stylesheets/common/components/buttons.scss b/app/assets/stylesheets/common/components/buttons.scss index 0c6fd078938..82cc92e38c2 100644 --- a/app/assets/stylesheets/common/components/buttons.scss +++ b/app/assets/stylesheets/common/components/buttons.scss @@ -299,10 +299,9 @@ &:focus { outline: none; - background: var(--primary-medium); - color: var(--secondary); + background: var(--primary-low); .d-icon { - color: var(--primary-low); + color: var(--primary); } } }