Skip to content

Commit

Permalink
fix(focus-states): Card, Breadcrumb, Checkbox (#61)
Browse files Browse the repository at this point in the history
* fix(card): removed outline none

* fix(comps): fixed focus on firefox

* fix(card): fixed merge conflict

* fix(breadcrumbs): removed tabindex

* fix(breadcrumbs): added comment
  • Loading branch information
marijohannessen authored and hellobrian committed May 26, 2017
1 parent 717cb5c commit d37fc06
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
11 changes: 10 additions & 1 deletion src/components/breadcrumb/_breadcrumb.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,18 @@
text-decoration: none;
border-bottom: 1px solid transparent;

&:hover {
&:hover,
&:focus {
outline: none;
color: $brand-01;
border-bottom: 1px solid $brand-01;
}

// Applies to Firefox only
@-moz-document url-prefix() {
& {
border-bottom: none;
}
}
}
}
17 changes: 13 additions & 4 deletions src/components/card/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
height: rem(240px);
background-color: $ui-01;
border: 1px solid $ui-04;

&:focus {
@include focus-outline('border');
}
}

.bx--card__card-overview {
Expand Down Expand Up @@ -153,23 +157,28 @@
.bx--app-actions__button {
@include font-size('16');
display: inline-block;
padding: 0;
margin: 0;
padding: .125rem 0 0;
margin: 0 .175rem;
cursor: pointer;
background: none;
border: none;

&:hover {
&:hover,
&:focus {
.bx--app-actions__button--icon {
fill: $brand-01;
}
}

&:focus {
@include focus-outline('border');
}
}

.bx--app-actions__button--icon {
width: 1rem;
height: 1rem;
margin: 0 .3rem;
margin: 0 .125rem;
transition: 200ms;
fill: $ui-05;
cursor: pointer;
Expand Down
8 changes: 7 additions & 1 deletion src/components/checkbox/_checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

.bx--checkbox:focus + .bx--checkbox-label .bx--checkbox-appearance,
.bx--checkbox:focus + .bx--checkbox-appearance {
@include focus-outline;
@include focus-outline('blurred');
}

.bx--checkbox-checkmark {
Expand All @@ -75,5 +75,11 @@
.bx--checkbox:checked + .bx--checkbox-appearance .bx--checkbox-checkmark,
.bx--checkbox:checked + .bx--checkbox-label .bx--checkbox-appearance .bx--checkbox-checkmark {
display: block;

@-moz-document url-prefix() {
& {
stroke: $brand-01;
}
}
}
}
3 changes: 1 addition & 2 deletions src/components/toggle/_toggle.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@
}

.bx--toggle__appearance:after {
box-shadow: 0 0 0 3px $color__blue-20;
outline: 1px solid transparent;
@include focus-outline('blurred');
}
}

Expand Down

0 comments on commit d37fc06

Please sign in to comment.