Skip to content

Commit

Permalink
fix: accessibility focus-visible default halo
Browse files Browse the repository at this point in the history
This commit addresses a UI issue where users are not being given
effective UI feedback when tabbing through most common experiences.

Changes to be committed:
modified:   src/_core.scss
  • Loading branch information
blackfalcon committed Feb 28, 2024
1 parent 0cd602c commit e8a10bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 28 deletions.
17 changes: 3 additions & 14 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,29 +107,18 @@
// if $focus-visible is true, override the default focus-visible outline
@if $focus-visible {
&:focus-visible {
outline: 2px solid var(--ds-color-ui-default-default, $ds-color-ui-default-default);
outline: 1px solid var(--ds-color-border-active-default, $ds-color-border-active-default);
}
} @else {
&:focus-visible {
outline: 0;
}
}
// if $focus-visible is true, override the default focus-visible outline
@if $focus-visible {
&:focus-visible {
outline: 2px solid var(--ds-color-ui-default-default, $ds-color-ui-default-default);
}
} @else {
&:focus-visible {
outline: 0;
outline: 1px solid var(--ds-color-border-active-default, $ds-color-border-active-default);
}
}
// if $focus is true, override the default focus outline
@if $focus {
&:focus {
outline: 2px solid var(--ds-color-ui-default-default, $ds-color-ui-default-default);
outline: 1px solid var(--ds-color-border-active-default, $ds-color-border-active-default);
}
}
}</code>" data-collapsed="#{$scope} * { ... }"><code>#{$scope} * { ... }</code></pre></div><h3 class="item__sub-heading">Description</h3><div class="item__description"><p>Global selector to address box-model and default <code>:focus</code> pseudo elements.</p><p>Global media setting for <a href="https://css-tricks.com/revisiting-prefers-reduced-motion-the-reduced-motion-media-query/#taking-it-to-code">a11y support of reduced-motion</a>. By setting the durations to almost 0, we prevent animation from playing for those with motion sensitivities without affecting transition or animation events (e.g. transitionend).</p><p><a href="/#scope-prefix-variable-scope">Manage</a> <code>$scope</code> option.</p></div><h3 class="item__sub-heading">Example</h3><div class="item__example example"><div class="example__description"><p>Default selector(s)</p></div><pre class="example__code language-scss"><code>*, *:before, *:after {}</code></pre></div><div class="item__example example"><div class="example__description"><p>Selector(s) when $scope: true;</p></div><pre class="example__code language-scss"><code>.auro *, .auro *:before, .auro *:after {}</code></pre></div><div class="item__example example"><div class="example__description"><p>import file</p></div><pre class="example__code language-scss"><code>@import &quot;./node_modules/@aurodesignsystem/webcorestylesheets/dist/core&quot;;</code></pre></div><div class="item__example example"><div class="example__description"><p>import file with <code>$focus</code> set to <code>true</code></p></div><pre class="example__code language-scss"><code>$focus: true;
Expand Down
17 changes: 3 additions & 14 deletions src/_core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,29 +44,18 @@ $focus-visible: null !default;
// if $focus-visible is true, override the default focus-visible outline
@if $focus-visible {
&:focus-visible {
outline: 2px solid var(--ds-color-ui-default-default, $ds-color-ui-default-default);
outline: 1px solid var(--ds-color-border-active-default, $ds-color-border-active-default);
}
} @else {
&:focus-visible {
outline: 0;
}
}

// if $focus-visible is true, override the default focus-visible outline
@if $focus-visible {
&:focus-visible {
outline: 2px solid var(--ds-color-ui-default-default, $ds-color-ui-default-default);
}
} @else {
&:focus-visible {
outline: 0;
outline: 1px solid var(--ds-color-border-active-default, $ds-color-border-active-default);
}
}

// if $focus is true, override the default focus outline
@if $focus {
&:focus {
outline: 2px solid var(--ds-color-ui-default-default, $ds-color-ui-default-default);
outline: 1px solid var(--ds-color-border-active-default, $ds-color-border-active-default);
}
}
}
Expand Down

0 comments on commit e8a10bc

Please sign in to comment.