From d6eb8c357c7d7d78bae0d2ed3dc67aca2b2295be Mon Sep 17 00:00:00 2001 From: Roy Schut Date: Thu, 24 Jun 2021 11:35:58 +0200 Subject: [PATCH] fix(project): focus state on focus-visible --- src/components/Button/Button.module.scss | 26 +++++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/components/Button/Button.module.scss b/src/components/Button/Button.module.scss index 4bd946e59..a63f238c5 100644 --- a/src/components/Button/Button.module.scss +++ b/src/components/Button/Button.module.scss @@ -24,6 +24,19 @@ $large-button-height: 40px; cursor: pointer; transition: background-color 0.1s ease, transform 0.1s ease; + @media (hover: hover) and (pointer: fine) { + &:hover, + &:focus { + transform: scale(1.1); + } + &:focus:not(:focus-visible):not(:hover) { + transform: scale(1); + } + &:focus-visible { + transform: scale(1.1); + } + } + &.large { height: $large-button-height; } @@ -42,7 +55,7 @@ $large-button-height: 40px; border: 1px solid rgba(255, 255, 255, 0.3); &.active, - &:focus { + &:focus-visible { color: var(--highlight-contrast-color, white); background-color: var(--highlight-color, black); border-color: var(--highlight-color); @@ -53,13 +66,12 @@ $large-button-height: 40px; background: none; opacity: 0.7; - &.active { + &.active, + &:focus { opacity: 1; } - &:hover { background: theme.$btn-default-bg; - transform: scale(1.1); opacity: 1; } } @@ -76,11 +88,6 @@ $large-button-height: 40px; width: 18px; height: 18px; } - - &:hover, - &:focus { - transform: scale(1.1); - } } .startIcon { @@ -90,7 +97,6 @@ $large-button-height: 40px; margin-right: 11px; > svg { - width: 20px; height: 20px; fill: currentColor;