fleet/frontend/components/buttons/Button/_styles.scss

158 lines
2.9 KiB
SCSS
Raw Normal View History

$gradient-start: #7166d9;
$gradient-end: #c86dd7;
2016-11-09 15:38:21 +00:00
$inverse-hover: #fafbff;
$base-class: 'button';
2016-11-09 15:38:21 +00:00
@mixin button-variant($color, $hover: null, $shadow: null) {
@if not $shadow {
$shadow: adjust-color($color, $lightness: -20%, $saturation: 20%);
}
2016-11-09 14:00:40 +00:00
2016-11-09 15:38:21 +00:00
@if not $hover {
$hover: darken($color, 5%);
}
background-color: $color;
box-shadow: 0 2px 0 $shadow, 0 3px 5px 0 rgba($black, 0.15);
&.#{$base-class}--disabled {
&:hover {
background-color: $color;
}
}
&:hover {
background-color: $hover;
2016-11-09 14:00:40 +00:00
}
}
.#{$base-class} {
2016-11-09 15:38:21 +00:00
@include user-select(none);
2017-01-05 15:26:10 +00:00
@include 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);
2016-11-09 15:38:21 +00:00
@include button-variant($link);
position: relative;
height: 38px;
text-align: center;
color: $white;
line-height: 36px;
text-decoration: none;
2016-11-09 15:38:21 +00:00
text-transform: uppercase;
letter-spacing: 1px;
border-radius: 2px;
font-size: $medium;
2016-11-09 15:38:21 +00:00
font-family: 'Oxygen', $helvetica;
font-weight: $bold;
2016-11-09 15:38:21 +00:00
display: inline-block;
padding: 0 $pad-large;
top: 0;
2016-11-09 14:00:40 +00:00
border: 0;
2016-11-09 15:38:21 +00:00
cursor: pointer;
box-sizing: border-box;
&:focus {
outline: none;
}
2016-11-09 15:38:21 +00:00
&--brand {
@include button-variant($brand);
}
2016-11-09 15:38:21 +00:00
&--success {
@include button-variant($success);
}
&--alert {
@include button-variant($alert);
}
&--warning {
@include button-variant($warning);
}
&--inverse {
2016-11-09 15:38:21 +00:00
@include button-variant($white, $inverse-hover, $brand);
color: $brand;
border: 1px solid $brand;
border-bottom-color: $white;
&:active {
border-bottom-color: $brand;
}
}
&--inverse-alert {
@include button-variant($white, $inverse-hover, $alert);
color: $alert;
border: 1px solid $alert;
border-bottom-color: $white;
&:active {
border-bottom-color: $alert;
}
}
2017-01-13 23:27:58 +00:00
&--block {
display: block;
width: 100%;
}
2016-11-09 15:38:21 +00:00
&--disabled {
opacity: 0.4;
cursor: default;
}
&--small {
height: 28px;
line-height: 26px;
padding: 0 $pad-medium;
}
&--large {
height: 48px;
line-height: 46px;
}
&--gradient {
background-color: transparent;
background-image: linear-gradient(134deg, $gradient-start 0%, $gradient-end 100%);
color: $white;
font-size: $large;
font-weight: $light;
letter-spacing: 4px;
padding: $medium;
width: 100%;
2016-11-09 15:38:21 +00:00
height: auto;
2016-12-16 15:54:49 +00:00
box-shadow: inset 0 -3px 0 0 rgba(0, 0, 0, 0.25), 0 -2px 3px 0 rgba(0, 0, 0, 0.15);
2016-12-09 18:36:17 +00:00
&:active {
2016-12-16 15:54:49 +00:00
box-shadow: 0 1px 0 #734893, 0 -2px 0 #d1d9e9;
2016-12-09 18:36:17 +00:00
}
2016-11-09 14:00:40 +00:00
}
&--unstyled {
2017-01-13 23:27:58 +00:00
@include button-variant(transparent);
border: 0;
box-shadow: none;
color: $text-dark;
cursor: pointer;
margin: 0;
padding: 0;
2016-11-09 15:38:21 +00:00
height: auto;
line-height: normal;
&:active {
box-shadow: none;
top: 0;
}
2016-11-09 15:38:21 +00:00
&:focus {
outline: none;
}
2016-11-09 15:38:21 +00:00
&:hover {
background-color: transparent;
box-shadow: none;
}
}
}