Skip to content

Commit

Permalink
fix(interface): ♿ show outline focus ring on keyboard focus
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesNZL committed Jul 17, 2022
1 parent be94ffe commit 956c8c3
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/style/stylesheet.scss
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ a {
box-shadow: 0 0 0 0.2rem map-get($options, 'shadow');
}

&:focus-visible {
outline: revert;
}

&:active {
color: map-get($options, 'text-active');
background-color: map-get($options, 'background-active');
Expand Down Expand Up @@ -359,14 +363,11 @@ select {
}

&:focus {
outline: none;
box-shadow: 0 0 0 0.2rem var(--element-shadow);
background-color: var(--element-hover);
}

&:focus-visible {
outline: none;
}

&.invalid-input {
box-shadow: 0 0 0 0.2rem rgba(red, calc(var(--shadow-multiplier) * 0.275));

Expand Down Expand Up @@ -440,18 +441,20 @@ select {
font-weight: 700;
}

&:focus {
&:focus-visible {
&~label:last-of-type::before {
box-shadow: 0 0 0 0.2rem var(--element-shadow);
background-color: var(--element-hover);
outline: 1px auto;
outline: -webkit-focus-ring-color auto 1px;
}
}

&:nth-of-type(1) {

&:checked,
&:active,
&:focus {
&:focus-visible {
&~label:last-of-type::before {
transform: translateX(calc(-1 * configuration.$border-width));
}
Expand All @@ -462,7 +465,7 @@ select {

&:checked,
&:active,
&:focus {
&:focus-visible {
&~label:last-of-type::before {
transform: translateX(calc(100% - 3 * configuration.$border-width));
}
Expand Down Expand Up @@ -511,7 +514,7 @@ select {

&:checked,
&:active,
&:focus {
&:focus-visible {
&~label:last-of-type::before {
transform: translateX(calc(200% - 5 * configuration.$border-width));
}
Expand Down

0 comments on commit 956c8c3

Please sign in to comment.