Skip to content

Commit

Permalink
Redesign focus outline styles (#863)
Browse files Browse the repository at this point in the history
  • Loading branch information
tysongach authored and BenMorganIO committed May 5, 2017
1 parent d840e13 commit e507548
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
10 changes: 10 additions & 0 deletions app/assets/stylesheets/administrate/base/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,13 @@ textarea {
select {
width: 100%;
}

[type="checkbox"],
[type="radio"],
[type="file"],
select {
&:focus {
outline: $focus-outline;
outline-offset: $focus-outline-offset;
}
}
7 changes: 5 additions & 2 deletions app/assets/stylesheets/administrate/base/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ a {
text-decoration: none;
transition: color $base-duration $base-timing;

&:active,
&:focus,
&:hover {
color: shade($action-color, 25%);
}

&:focus {
outline: $focus-outline;
outline-offset: $focus-outline-offset;
}
}

hr {
Expand Down
8 changes: 6 additions & 2 deletions app/assets/stylesheets/administrate/components/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@
vertical-align: middle;
white-space: nowrap;

&:hover,
&:focus {
&:hover {
background-color: shade($action-color, 20%);
color: $white;
}

&:focus {
outline: $focus-outline;
outline-offset: $focus-outline-offset;
}

&:disabled {
cursor: not-allowed;
opacity: 0.5;
Expand Down
5 changes: 5 additions & 0 deletions app/assets/stylesheets/administrate/library/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ $action-color: $blue;
// Background Colors
$base-background-color: $grey-0;

// Focus
$focus-outline-color: transparentize($action-color, 0.4);
$focus-outline: 3px solid $focus-outline-color;
$focus-outline-offset: 1px;

// Flash Colors
$flash-colors: (
alert: $light-yellow,
Expand Down

0 comments on commit e507548

Please sign in to comment.