1 | @import "settings.global";
|
2 |
|
3 | @mixin button-color($background-color: $button-background-color, $color: $button-color) {
|
4 | border: $button-border;
|
5 | background-color: $background-color;
|
6 | color: $color;
|
7 |
|
8 | &.c-button--active {
|
9 | background-color: darken($background-color, $color-tint);
|
10 | }
|
11 |
|
12 | &:not(:disabled) {
|
13 | &:hover {
|
14 | background-color: lighten($background-color, $color-tint);
|
15 | }
|
16 |
|
17 | &:focus {
|
18 | border-color: $button-focus-border-color;
|
19 | box-shadow: $button-focus-box-shadow;
|
20 | }
|
21 |
|
22 | &:active {
|
23 | background-color: darken($background-color, $color-tint);
|
24 | }
|
25 | }
|
26 | }
|
27 |
|
28 | @mixin button-ghost($color: $button-ghost-color, $color-hover: $button-ghost-hover-color) {
|
29 | border: $button-ghost-border-width $button-ghost-border-style $color;
|
30 | background-color: transparent;
|
31 | color: $color;
|
32 |
|
33 | &.c-button--active {
|
34 | border-color: darken($color, $color-tint);
|
35 | background-color: darken($color, $color-tint);
|
36 | color: $color-hover;
|
37 | }
|
38 |
|
39 | &:not(:disabled) {
|
40 | &:hover {
|
41 | background-color: $color;
|
42 | color: $color-hover;
|
43 | }
|
44 |
|
45 | &:focus {
|
46 | border-color: $button-focus-border-color;
|
47 | box-shadow: $button-focus-box-shadow;
|
48 | }
|
49 |
|
50 | &:active {
|
51 | border-color: darken($color, $color-tint);
|
52 | background-color: darken($color, $color-tint);
|
53 | color: $color-hover;
|
54 | }
|
55 | }
|
56 | }
|
57 |
|
58 | @mixin button {
|
59 | @include button-color;
|
60 | display: inline;
|
61 | max-width: 100%;
|
62 | margin: $button-margin;
|
63 | padding: $button-padding;
|
64 | border-radius: $button-border-radius;
|
65 | outline: 0;
|
66 | font-family: $button-font-family;
|
67 | font-size: $button-font-size;
|
68 | line-height: $button-line-height;
|
69 | text-align: $button-text-align;
|
70 | text-decoration: none;
|
71 | text-overflow: ellipsis;
|
72 | white-space: $button-white-space;
|
73 | cursor: pointer;
|
74 | overflow: hidden;
|
75 | vertical-align: middle;
|
76 | appearance: none;
|
77 | user-select: none;
|
78 |
|
79 | &:disabled {
|
80 | cursor: not-allowed;
|
81 | opacity: $button-disabled-opacity;
|
82 | }
|
83 | }
|