Skip to content

Commit

Permalink
[#255] Corrects default <Button> theme
Browse files Browse the repository at this point in the history
- Ensures disabled buttons are not "visually pressed" when pressed.
- Ensures the focus highlight is applied to buttons in active (pressed)
state.
  • Loading branch information
birdofpreyru committed Aug 22, 2022
1 parent 527548a commit a035c97
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/shared/components/Button/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,32 @@
color: inherit;
}

&:hover {
&.active,
&:active {
background-image: linear-gradient(to bottom, lightgray, white 50%, white);
box-shadow: inset 0 1px 3px 0 lightgray;
border-color: gray;
cursor: pointer;
}

&:focus {
box-shadow: 0 0 3px 1px lightblue;
border-color: blue;
outline: none;
}

&.active,
&:active {
background-image: linear-gradient(to bottom, lightgray, white 50%, white);
box-shadow: inset 0 1px 3px 0 lightgray;
border-color: gray;
}
}

/* Additional styling of disabled buttons. */
&.disabled {
cursor: not-allowed;
opacity: 0.33;

// Note: this "cancels out" the active state styling of an active button,
// which is defined above, thus ensuring a click on disabled button does
// not alter its appearance (does not result in visual press).
&.active,
&:active {
background-image: linear-gradient(to top, lightgray, white 50%, white);
box-shadow: none;
}
}
}

0 comments on commit a035c97

Please sign in to comment.