Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Commit

Permalink
fix: button interaction states
Browse files Browse the repository at this point in the history
Update the interaction states of buttons.

fix #320
  • Loading branch information
Schalk Neethling committed Dec 5, 2020
1 parent 1964e7c commit bbd3ee2
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
13 changes: 5 additions & 8 deletions sass/atoms/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ a.button {
text-decoration: none;

&:hover,
&:focus {
text-decoration: underline;
}

&:focus,
&:active {
text-decoration: none;
}
Expand All @@ -31,12 +28,12 @@ a.outline {

.danger,
a.danger {
@include button-state($bg-color: $red-200, $bg-hover-color: $red-100);
@include button-state($bg-color: $red-100, $bg-hover-color: $red-200);

&.outline {
@include outline-button-state(
$border-color: $red-200,
$bg-hover-color: $red-100,
$bg-hover-color: $red-200,
$bg-active-color: $red-200,
$text-hover-color: $neutral-600
);
Expand All @@ -45,12 +42,12 @@ a.danger {

.positive,
a.positive {
@include button-state($bg-color: $green-200, $bg-hover-color: $green-100);
@include button-state($bg-color: $green-100, $bg-hover-color: $green-200);

&.outline {
@include outline-button-state(
$border-color: $green-200,
$bg-hover-color: $green-100,
$bg-hover-color: $green-200,
$bg-active-color: $green-200,
$text-hover-color: $neutral-600
);
Expand Down
1 change: 1 addition & 0 deletions sass/mdn-minimalist.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@import "./vars/color-palette";
@import "./vars/layout";
@import "./vars/borders";
@import "./vars/shadows";
@import "./vars/typography";

@import "./mixins/animation";
Expand Down
4 changes: 2 additions & 2 deletions sass/mixins/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* @param `$text-hover-color` - foreground text color for hover state [default: null]
*/
@mixin button-state(
$bg-color: $primary-200,
$bg-hover-color: $primary-100,
$bg-color: $primary-100,
$bg-hover-color: $primary-200,
$bg-active-color: $bg-color,
$text-color: $text-color-inverted,
$text-hover-color: null
Expand Down
2 changes: 2 additions & 0 deletions sass/vars/_shadows.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$button-active-state-shadow: 1px 1px 0 3px $primary-300,
-1px -1px 0 3px $primary-300;
12 changes: 6 additions & 6 deletions test/sass/_test-mixins-buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
}

@include expect {
background-color: #1e7f9d;
border: 2px solid #1e7f9d;
background-color: #216b82;
border: 2px solid #216b82;
color: #fff;

&:hover,
&:focus {
background-color: #216b82;
border-color: #216b82;
background-color: #1e7f9d;
border-color: #1e7f9d;
}

&:active {
background-color: #1e7f9d;
border-color: #1e7f9d;
background-color: #216b82;
border-color: #216b82;
}
}
}
Expand Down

0 comments on commit bbd3ee2

Please sign in to comment.