84 lines
2 KiB
SCSS
84 lines
2 KiB
SCSS
// Button
|
|
//
|
|
// In addition to the default styling of `<button>` and
|
|
// `<input type="submit|image|reset|button">` elements, the `.button` class and
|
|
// its variants can apply buttons styles to various elements (like an `<a>`
|
|
// link).
|
|
//
|
|
// :hover - Hover styling.
|
|
// :active - Depressed button styling.
|
|
|
|
.button,
|
|
%button,
|
|
button,
|
|
[type='button'],
|
|
[type='reset'],
|
|
[type='submit'] {
|
|
@extend %button--disabled;
|
|
@include typeface(headings);
|
|
@include margin-right(.75);
|
|
@include margin-bottom(.75);
|
|
// Some styles don't apply to <a> links since they are inline elements by default.
|
|
display: inline-block;
|
|
padding: 4px 10px;
|
|
text-decoration: none;
|
|
text-align: center;
|
|
// Improve usability and consistency of cursor style between image-type `input` and others.
|
|
cursor: pointer;
|
|
color: var(--color-button-text);
|
|
background-color: var(--color-button);
|
|
border: 0;
|
|
border-radius: 2px;
|
|
|
|
&:hover,
|
|
&:focus,
|
|
&:active {
|
|
// Override any link underlines and color changes.
|
|
text-decoration: none;
|
|
color: var(--color-button);
|
|
background-color: var(--color-button-text);
|
|
}
|
|
}
|
|
|
|
// Add button variations here.
|
|
.button,
|
|
%button {
|
|
&--small {
|
|
@include type-layout(xs, 1);
|
|
@include margin-right(.3);
|
|
@include margin-bottom(.3);
|
|
padding: 2px 6px;
|
|
}
|
|
|
|
&--outline {
|
|
color: var(--color-button);
|
|
background-color: var(--color-button-text);
|
|
border: 1px solid var(--color-button);
|
|
|
|
&:hover,
|
|
&:focus,
|
|
&:active {
|
|
color: var(--color-button-text);
|
|
background-color: var(--color-button);
|
|
}
|
|
}
|
|
}
|
|
|
|
// The disabled variation should always go last, so that it overrides any
|
|
// other variations.
|
|
%button--disabled[disabled] {
|
|
// Re-set default cursor for disabled elements.
|
|
cursor: default;
|
|
color: var(--color-button-disabled);
|
|
background-color: var(--color-grey-extra-light);
|
|
border-color: var(--color-grey-extra-light);
|
|
background-image: none;
|
|
text-shadow: none;
|
|
|
|
&:hover,
|
|
&:focus,
|
|
&:active {
|
|
// Override any link underlines and color changes.
|
|
color: var(--color-button-disabled);
|
|
}
|
|
}
|