Skip to content

Commit

Permalink
Merge pull request #243 from emeliese/fix/focus-state-rework
Browse files Browse the repository at this point in the history
fix: change box-shadow style for focus state
  • Loading branch information
splashdust authored Nov 27, 2020
2 parents fc26277 + 6e67786 commit d1ee073
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
/// Add focus outline to element
///
/// @access public
@mixin vanilla-focus-outline() {
box-shadow: 0 0 0 3px rgba($vanilla-color-component-selected, 0.2);
@mixin vanilla-focus-outline($shadow-color: $vanilla-color-blue, $opacity: 1) {
box-shadow: 0 0 4px 1px rgba($shadow-color, $opacity);
transition: box-shadow 250ms;
}

Expand Down
16 changes: 16 additions & 0 deletions src/components/buttons/_button-mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ $_ghost-button_disabled-opacity: 0.5;
color: $vanilla-color-white;
background-color: transparent;

&:focus {
@include vanilla-focus-outline($vanilla-color-white, 0.9);
}

&:focus,
&:hover,
&:active {
Expand All @@ -199,6 +203,10 @@ $_ghost-button_disabled-opacity: 0.5;
color: $vanilla-color-grey2;
background-color: transparent;

&:focus {
@include vanilla-focus-outline($vanilla-color-grey700);
}

&:focus,
&:hover,
&:active {
Expand Down Expand Up @@ -230,6 +238,10 @@ $_ghost-button_disabled-opacity: 0.5;
background-color: transparent;
border-color: transparent;

&:focus {
@include vanilla-focus-outline($vanilla-color-red);
}

&:focus,
&:hover,
&:active {
Expand All @@ -253,6 +265,10 @@ $_ghost-button_disabled-opacity: 0.5;
background-color: $vanilla-color-darkred1;
border-color: $vanilla-color-darkred1;

&:focus {
@include vanilla-focus-outline($vanilla-color-red);
}

&:focus,
&:hover,
&:active {
Expand Down

0 comments on commit d1ee073

Please sign in to comment.