Skip to content

Commit

Permalink
redo outlines
Browse files Browse the repository at this point in the history
- removes original outline removal (hah)
- replaces it with an explicit `outline: 0` on `.btn`
- instead of replicating `:hover` for `:focus`, uses custom and themed `box-shadow` for an "outline"
- not mapped to the `$enable-shadows` variable because accessibility
  • Loading branch information
mdo committed Dec 28, 2016
1 parent 79cfc09 commit 62c4cb2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
10 changes: 3 additions & 7 deletions scss/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,14 @@
@include button-size($btn-padding-y, $btn-padding-x, $font-size-base, $btn-border-radius);
@include transition($btn-transition);

&:focus,
&.focus {
@include tab-focus();
}

// Share hover and focus styles
@include hover-focus {
text-decoration: none;
}
&:focus,
&.focus {
text-decoration: none;
outline: 0;
box-shadow: 0 0 0 2px rgba($brand-primary, .25);
}

// Disabled comes first so active can properly restyle
Expand All @@ -41,7 +38,6 @@
&:active,
&.active {
background-image: none;
outline: 0;
@include box-shadow($btn-active-box-shadow);
}
}
Expand Down
5 changes: 2 additions & 3 deletions scss/mixins/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
color: $color;
background-color: $active-background;
border-color: $active-border;
box-shadow: 0 0 0 2px rgba($border, .5);
}

// Disabled comes first so active can properly restyle
Expand Down Expand Up @@ -57,9 +58,7 @@

&:focus,
&.focus {
color: $color-hover;
background-color: $color;
border-color: $color;
box-shadow: 0 0 0 2px rgba($color, .5);
}

&.disabled,
Expand Down

0 comments on commit 62c4cb2

Please sign in to comment.