_button.scss
2.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
.btn {
background-color: $white;
background-image: none;
background-position: 50% 50%;
background-size: 100% 100%;
border: 1px solid transparent;
border-radius: 2px;
color: $black-text;
cursor: pointer;
display: inline-block;
font-size: $font-size;
font-weight: 400;
line-height: $line-height;
margin-bottom: 0;
max-width: 100%;
padding: (($btn-height - $line-height - 2) / 2) ($grid-gutter - 1);
position: relative;
text-align: center;
text-transform: uppercase;
vertical-align: middle;
white-space: nowrap;
@include box-shadow(0 1px 5px rgba(0, 0, 0, 0.15), 0 1px 5px 1px rgba(0, 0, 0, 0.15));
@include transition(background-color 0.3s $timing, box-shadow 0.3s $timing);
@include user-select(none);
&:active,
&:focus,
&:hover {
color: $black-text;
outline: 0;
text-decoration: none;
@include box-shadow(0 1px 5px rgba(0, 0, 0, 0.15), 0 5px 10px 1px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.15));
}
&[disabled],
fieldset[disabled] & {
cursor: not-allowed;
@include opacity(0.5);
}
&.waves-effect {
border: 0;
padding: (($btn-height - $line-height) / 2) $grid-gutter;
}
}
// colour
@each $color in $palette-list {
$i: index($palette-list, $color);
.btn-#{$color} {
background-color: nth($palette-color, $i);
color: $white;
&:active,
&:focus,
&:hover {
color: $white;
}
&[disabled],
fieldset[disabled] & {
background-color: nth($palette-color, $i);
}
}
}
// size
.btn-sm {
font-size: $font-size-h6;
line-height: ($line-height - 2);
padding: 0 ($grid-gutter / 2 - 1);
&.waves-effect {
padding: 1px ($grid-gutter / 2);
}
}
.btn-block {
display: block;
white-space: normal;
width: 100%;
}
.btn-flat {
background-color: transparent;
@include box-shadow(none);
&:active,
&:focus,
&:hover {
background-color: $black-bg;
@include box-shadow(none);
}
&[disabled],
fieldset[disabled] & {
color: $black-text;
}
}
// colour
@each $color in $palette-list {
$i: index($palette-list, $color);
.btn-flat.btn-#{$color} {
color: nth($palette-color, $i);
&:active,
&:focus,
&:hover {
background-color: nth($palette-color-light, $i);
}
&[disabled],
fieldset[disabled] & {
color: nth($palette-color, $i);
}
}
}
.btn-text {
color: $black-text;
display: inline-block;
font-size: $font-size;
font-weight: 400;
line-height: $line-height;
padding: (($btn-height - $line-height) / 2) 0;
}