1
|
//
|
2
|
// Component: Button
|
3
|
//
|
4
|
// ========================================================================
|
5
|
|
6
|
|
7
|
// Variables
|
8
|
// ========================================================================
|
9
|
|
10
|
@button-line-height: @global-control-height - (@button-border-width * 2);
|
11
|
@button-small-line-height: @global-control-small-height - (@button-border-width * 2);
|
12
|
@button-large-line-height: @global-control-large-height - (@button-border-width * 2);
|
13
|
|
14
|
@button-font-size: @global-small-font-size;
|
15
|
@button-large-font-size: @global-small-font-size;
|
16
|
|
17
|
@button-default-background: transparent;
|
18
|
@button-default-hover-background: transparent;
|
19
|
@button-default-active-background: transparent;
|
20
|
|
21
|
@button-disabled-background: transparent;
|
22
|
|
23
|
@button-text-color: @global-emphasis-color;
|
24
|
@button-text-hover-color: @global-emphasis-color;
|
25
|
|
26
|
//
|
27
|
// New
|
28
|
//
|
29
|
|
30
|
@button-text-transform: uppercase;
|
31
|
|
32
|
@button-border-width: @global-border-width;
|
33
|
|
34
|
@button-default-border: @global-border;
|
35
|
@button-default-hover-border: darken(@global-border, 20%);
|
36
|
@button-default-active-border: darken(@global-border, 30%);
|
37
|
|
38
|
@button-disabled-border: @global-border;
|
39
|
|
40
|
@button-text-border-width: @global-border-width;
|
41
|
@button-text-border: @button-text-hover-color;
|
42
|
|
43
|
|
44
|
// Component
|
45
|
// ========================================================================
|
46
|
|
47
|
.hook-button() {
|
48
|
text-transform: @button-text-transform;
|
49
|
-webkit-transition: 0.1s ease-in-out;
|
50
|
transition: 0.1s ease-in-out;
|
51
|
-webkit-transition-property: color, background-color, border-color;
|
52
|
transition-property: color, background-color, border-color;
|
53
|
}
|
54
|
|
55
|
.hook-button-hover() {}
|
56
|
|
57
|
.hook-button-focus() {}
|
58
|
|
59
|
.hook-button-active() {}
|
60
|
|
61
|
|
62
|
// Style modifiers
|
63
|
// ========================================================================
|
64
|
|
65
|
.hook-button-default() { border: @button-border-width solid @button-default-border; }
|
66
|
|
67
|
.hook-button-default-hover() { border-color: @button-default-hover-border; }
|
68
|
|
69
|
.hook-button-default-active() { border-color: @button-default-active-border; }
|
70
|
|
71
|
//
|
72
|
// Primary
|
73
|
//
|
74
|
|
75
|
.hook-button-primary() { border: @button-border-width solid transparent; }
|
76
|
|
77
|
.hook-button-primary-hover() {}
|
78
|
|
79
|
.hook-button-primary-active() {}
|
80
|
|
81
|
//
|
82
|
// Secondary
|
83
|
//
|
84
|
|
85
|
.hook-button-secondary() { border: @button-border-width solid transparent; }
|
86
|
|
87
|
.hook-button-secondary-hover() {}
|
88
|
|
89
|
.hook-button-secondary-active() {}
|
90
|
|
91
|
//
|
92
|
// Danger
|
93
|
//
|
94
|
|
95
|
.hook-button-danger() { border: @button-border-width solid transparent; }
|
96
|
|
97
|
.hook-button-danger-hover() {}
|
98
|
|
99
|
.hook-button-danger-active() {}
|
100
|
|
101
|
|
102
|
// Disabled
|
103
|
// ========================================================================
|
104
|
|
105
|
.hook-button-disabled() { border-color: @button-disabled-border; }
|
106
|
|
107
|
|
108
|
// Size modifiers
|
109
|
// ========================================================================
|
110
|
|
111
|
.hook-button-small() {}
|
112
|
|
113
|
.hook-button-large() {}
|
114
|
|
115
|
|
116
|
// Text modifier
|
117
|
// ========================================================================
|
118
|
|
119
|
.hook-button-text() {
|
120
|
|
121
|
position: relative;
|
122
|
|
123
|
&::before {
|
124
|
content: "";
|
125
|
position: absolute;
|
126
|
bottom: 0;
|
127
|
left: 0;
|
128
|
right: 100%;
|
129
|
border-bottom: @button-text-border-width solid @button-text-border;
|
130
|
-webkit-transition: right 0.3s ease-out;
|
131
|
transition: right 0.3s ease-out;
|
132
|
}
|
133
|
|
134
|
}
|
135
|
|
136
|
.hook-button-text-hover() {
|
137
|
|
138
|
&::before { right: 0; }
|
139
|
|
140
|
}
|
141
|
|
142
|
.hook-button-text-disabled() {
|
143
|
|
144
|
&::before { display: none; }
|
145
|
|
146
|
}
|
147
|
|
148
|
|
149
|
// Link modifier
|
150
|
// ========================================================================
|
151
|
|
152
|
.hook-button-link() {}
|
153
|
|
154
|
|
155
|
// Miscellaneous
|
156
|
// ========================================================================
|
157
|
|
158
|
.hook-button-misc() {
|
159
|
|
160
|
/* Group
|
161
|
========================================================================== */
|
162
|
|
163
|
/*
|
164
|
* Collapse border
|
165
|
*/
|
166
|
|
167
|
.uk-button-group > .uk-button:nth-child(n+2),
|
168
|
.uk-button-group > div:nth-child(n+2) .uk-button { margin-left: -@button-border-width; }
|
169
|
|
170
|
/*
|
171
|
* Create position context to superimpose the successor elements border
|
172
|
* Known issue: If you use an `a` element as button and an icon inside,
|
173
|
* the active state will not work if you click the icon inside the button
|
174
|
* Workaround: Just use a `button` or `input` element as button
|
175
|
*/
|
176
|
|
177
|
.uk-button-group .uk-button:hover,
|
178
|
.uk-button-group .uk-button:focus,
|
179
|
.uk-button-group .uk-button:active,
|
180
|
.uk-button-group .uk-button.uk-active {
|
181
|
position: relative;
|
182
|
z-index: 1;
|
183
|
}
|
184
|
|
185
|
}
|
186
|
|
187
|
|
188
|
// Inverse
|
189
|
// ========================================================================
|
190
|
|
191
|
@inverse-button-default-background: transparent;
|
192
|
@inverse-button-default-color: @inverse-global-emphasis-color;
|
193
|
@inverse-button-default-hover-background: transparent;
|
194
|
@inverse-button-default-hover-color: @inverse-global-emphasis-color;
|
195
|
@inverse-button-default-active-background: transparent;
|
196
|
@inverse-button-default-active-color: @inverse-global-emphasis-color;
|
197
|
|
198
|
@inverse-button-text-color: @inverse-global-emphasis-color;
|
199
|
@inverse-button-text-hover-color: @inverse-global-emphasis-color;
|
200
|
|
201
|
//
|
202
|
// Hooks
|
203
|
//
|
204
|
|
205
|
.hook-inverse-button-default() { border-color: @inverse-global-color; }
|
206
|
.hook-inverse-button-default-hover() { border-color: @inverse-global-emphasis-color; }
|
207
|
.hook-inverse-button-default-active() { border-color: @inverse-global-emphasis-color; }
|
208
|
|
209
|
.hook-inverse-button-primary() {}
|
210
|
.hook-inverse-button-primary-hover() {}
|
211
|
.hook-inverse-button-primary-active() {}
|
212
|
|
213
|
.hook-inverse-button-secondary() {}
|
214
|
.hook-inverse-button-secondary-hover() {}
|
215
|
.hook-inverse-button-secondary-active() {}
|
216
|
|
217
|
.hook-inverse-button-text() {
|
218
|
&::before { border-bottom-color: @inverse-global-emphasis-color; }
|
219
|
}
|
220
|
.hook-inverse-button-text-hover() {}
|
221
|
.hook-inverse-button-text-disabled() {}
|