fleet/frontend/components/buttons/Button/_styles.scss
Gabe Hernandez efb35b537a
add prettier and have it format all fleet application code (#625)
* add prettier and have it format all js code except website:
:

* trying running prettier check in CI

* fix runs on in CI

* change CI job name

* fix prettier erros and fix CI
2021-04-12 14:32:25 +01:00

207 lines
3.6 KiB
SCSS

$base-class: "button";
@mixin button-variant($color, $hover: null, $active: null, $inverse: null) {
background-color: $color;
@if $inverse {
&:hover {
border: 2px solid $hover;
color: $hover;
}
&:active {
border: 2px solid $active;
color: $active;
}
} @else {
&:hover {
background-color: $hover;
}
&:active {
background-color: $active;
}
}
}
.#{$base-class} {
@include button-variant($core-blue);
transition: color 150ms ease-in-out, background 150ms ease-in-out,
top 50ms ease-in-out, box-shadow 50ms ease-in-out, border 50ms ease-in-out;
position: relative;
color: $white;
text-decoration: none;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 8px 16px;
border-radius: 4px;
font-size: $small;
font-family: "Nunito Sans", sans-serif;
font-weight: $bold;
display: inline-flex;
height: 38px;
top: 0;
border: 0;
cursor: pointer;
&:focus {
outline: none;
}
&--brand {
@include button-variant($core-blue, $core-blue-over, $core-blue-down);
}
&--success {
@include button-variant($success);
}
&--alert {
@include button-variant($alert, $core-red-over, $core-red-down);
}
&--blue-green {
@include button-variant($core-blue-green);
}
&--grey {
@include button-variant(
$core-medium-blue-grey,
$core-dark-blue-grey-over,
$core-dark-blue-grey-down
);
}
&--warning {
@include button-variant($warning);
}
&--link {
@include button-variant($core-purple);
}
&--label {
@include button-variant(
$core-light-blue-grey,
$core-blue-over,
null,
$inverse: true
);
color: $core-blue;
border: 1px solid $core-blue;
box-sizing: border-box;
font-size: $xx-small;
padding: 4px 10px;
height: 24px;
&:active {
box-shadow: inset 2px 2px 2px rgba(0, 0, 0, 0.25);
}
&:hover {
border: 1px solid $core-blue;
}
}
&--text-link {
@include button-variant(transparent);
border: 0;
box-shadow: none;
color: $core-blue;
font-size: $x-small;
cursor: pointer;
margin: 0;
padding: 0;
height: auto;
line-height: normal;
&:active {
color: $core-blue-down;
box-shadow: none;
top: 0;
}
&:focus {
outline: none;
}
&:hover {
color: $core-blue-over;
background-color: transparent;
box-shadow: none;
text-decoration: underline;
}
}
&--inverse {
@include button-variant(
$white,
$core-blue-over,
$core-blue-down,
$inverse: true
);
color: $core-blue;
border: 2px solid $core-blue;
box-sizing: border-box;
}
&--inverse-alert {
@include button-variant(
$white,
$core-red-over,
$core-red-down,
$inverse: true
);
color: $alert;
border: 2px solid $alert;
box-sizing: border-box;
}
&--block {
display: block;
width: 100%;
}
&--disabled {
opacity: 0.4;
filter: grayscale(1);
cursor: default;
&:hover {
cursor: default;
}
}
&--unstyled {
@include button-variant(transparent);
border: 0;
box-shadow: none;
color: $core-dark-blue-grey;
cursor: pointer;
margin: 0;
padding: 0;
height: auto;
line-height: normal;
&:active {
box-shadow: none;
top: 0;
}
&:focus {
outline: none;
}
&:hover {
background-color: transparent;
box-shadow: none;
}
}
&--contextual-nav-item {
@include button-variant(transparent, $core-blue-label-over);
display: flex;
justify-content: space-between;
}
}