1
|
// Copyright (C) YOOtheme GmbH, YOOtheme Proprietary Use License (http://www.yootheme.com/license) */
|
2
|
|
3
|
//
|
4
|
// OMTDComponent: Button
|
5
|
//
|
6
|
// ========================================================================
|
7
|
|
8
|
|
9
|
// Variables
|
10
|
// ========================================================================
|
11
|
|
12
|
@button-height: @global-height;
|
13
|
@button-mini-height: @global-height-mini;
|
14
|
@button-small-height: @global-height-small;
|
15
|
@button-large-height: @global-height-large;
|
16
|
|
17
|
@button-line-height: @global-height;
|
18
|
@button-mini-line-height: @global-height-mini;
|
19
|
@button-small-line-height: @global-height-small;
|
20
|
@button-large-line-height: @global-height-large;
|
21
|
|
22
|
@button-mini-font-size: round((@global-font-size * 0.733)); // 11px
|
23
|
@button-small-font-size: round((@global-font-size * 0.8)); // 12px
|
24
|
@button-large-font-size: round((@global-font-size * 1.067)); // 16px
|
25
|
|
26
|
@button-background: rgba(0,0,0,0);
|
27
|
@button-color: @global-color;
|
28
|
@button-hover-background: rgba(0,0,0,0);
|
29
|
@button-hover-color: @global-contrast-color;
|
30
|
@button-active-background: rgba(0,0,0,0);
|
31
|
@button-active-color: @global-contrast-color;
|
32
|
|
33
|
@button-primary-background: @global-primary-background;
|
34
|
@button-primary-color: @global-contrast-color;
|
35
|
@button-primary-hover-background: darken(@global-primary-background, 10%);
|
36
|
@button-primary-hover-color: @global-contrast-color;
|
37
|
@button-primary-active-background: darken(@global-primary-background, 15%);
|
38
|
@button-primary-active-color: @global-contrast-color;
|
39
|
|
40
|
@button-success-background: @global-success-background;
|
41
|
@button-success-color: @global-contrast-color;
|
42
|
@button-success-hover-background: desaturate(darken(@global-success-background, 5%), 10%);
|
43
|
@button-success-hover-color: @global-contrast-color;
|
44
|
@button-success-active-background: desaturate(darken(@global-success-background, 10%), 10%);
|
45
|
@button-success-active-color: @global-contrast-color;
|
46
|
|
47
|
@button-danger-background: @global-danger-background;
|
48
|
@button-danger-color: @global-contrast-color;
|
49
|
@button-danger-hover-background: desaturate(darken(@global-danger-background, 5%), 10%);
|
50
|
@button-danger-hover-color: @global-contrast-color;
|
51
|
@button-danger-active-background: desaturate(darken(@global-danger-background, 10%), 15%);
|
52
|
@button-danger-active-color: @global-contrast-color;
|
53
|
|
54
|
@button-disabled-color: @global-muted-color;
|
55
|
|
56
|
@button-link-color: @global-color;
|
57
|
@button-link-hover-color: @global-color;
|
58
|
@button-link-hover-text-decoration: none;
|
59
|
@button-link-disabled-color: @global-muted-color;
|
60
|
|
61
|
//
|
62
|
// New
|
63
|
//
|
64
|
|
65
|
@button-border-width: @global-border-width;
|
66
|
@button-border: #999;
|
67
|
@button-hover-border: #444;
|
68
|
@button-active-border: #333;
|
69
|
@button-link-font-family: 'Chester';
|
70
|
@button-link-icon: "\e901";
|
71
|
|
72
|
|
73
|
// OMTDComponent
|
74
|
// ========================================================================
|
75
|
|
76
|
.hook-button() {
|
77
|
|
78
|
position: relative;
|
79
|
border: @button-border-width solid @button-border;
|
80
|
overflow: hidden;
|
81
|
-webkit-transition: color .4s, background .2s;
|
82
|
transition: color .4s, background .2s;
|
83
|
z-index: 1;
|
84
|
|
85
|
&:not(.uk-button-link):before {
|
86
|
content: "";
|
87
|
position: absolute;
|
88
|
left: -160%;
|
89
|
height: 100%;
|
90
|
width: 130%;
|
91
|
background: @button-hover-border;
|
92
|
-webkit-transform: skewX(20deg);
|
93
|
transform: skewX(20deg);
|
94
|
-webkit-transition: left .4s;
|
95
|
transition: left .4s;
|
96
|
z-index: -1;
|
97
|
}
|
98
|
|
99
|
}
|
100
|
|
101
|
.hook-button-hover() {
|
102
|
|
103
|
border-color: @button-hover-border;
|
104
|
|
105
|
&:not(.uk-button-link):before { left: -15%; }
|
106
|
|
107
|
}
|
108
|
|
109
|
.hook-button-active() {
|
110
|
|
111
|
border-color: @button-active-border;
|
112
|
|
113
|
&:not(.uk-button-link):before {
|
114
|
left: -15%;
|
115
|
background: @button-active-border;
|
116
|
}
|
117
|
|
118
|
}
|
119
|
|
120
|
|
121
|
// Color modifiers
|
122
|
// ========================================================================
|
123
|
|
124
|
//
|
125
|
// Modifier: `uk-button-primary`
|
126
|
//
|
127
|
|
128
|
.hook-button-primary() {
|
129
|
|
130
|
border-color: transparent;
|
131
|
|
132
|
&:before { background: none !important; }
|
133
|
|
134
|
}
|
135
|
|
136
|
.hook-button-primary-hover() { border-color: transparent; }
|
137
|
.hook-button-primary-active() { border-color: transparent; }
|
138
|
|
139
|
//
|
140
|
// Modifier: `uk-button-success`
|
141
|
//
|
142
|
|
143
|
.hook-button-success() {
|
144
|
|
145
|
border-color: transparent;
|
146
|
|
147
|
&:before { background: none !important; }
|
148
|
|
149
|
}
|
150
|
|
151
|
.hook-button-success-hover() { border-color: transparent; }
|
152
|
.hook-button-success-active() { border-color: transparent; }
|
153
|
|
154
|
//
|
155
|
// Modifier: `uk-button-danger`
|
156
|
//
|
157
|
|
158
|
.hook-button-danger() {
|
159
|
|
160
|
border-color: transparent;
|
161
|
|
162
|
&:before { background: none !important; }
|
163
|
|
164
|
}
|
165
|
|
166
|
.hook-button-danger-hover() { border-color: transparent; }
|
167
|
.hook-button-danger-active() { border-color: transparent; }
|
168
|
|
169
|
|
170
|
// Disabled state
|
171
|
// ========================================================================
|
172
|
|
173
|
.hook-button-disable() {
|
174
|
|
175
|
border-color: transparent;
|
176
|
|
177
|
&:before { background: none !important; }
|
178
|
|
179
|
}
|
180
|
|
181
|
|
182
|
// Modifier: `uk-button-link`
|
183
|
// ========================================================================
|
184
|
|
185
|
.hook-button-link() {
|
186
|
|
187
|
&:hover,
|
188
|
&:focus { text-decoration: none; }
|
189
|
|
190
|
&:not(:disabled) {
|
191
|
|
192
|
position: relative;
|
193
|
padding-left: 0;
|
194
|
padding-right: 25px;
|
195
|
|
196
|
&:before,
|
197
|
&:after {
|
198
|
content: "";
|
199
|
position: absolute;
|
200
|
-webkit-transition: right .2s, width .2s;
|
201
|
transition: right .2s, width .2s;
|
202
|
}
|
203
|
|
204
|
&:before {
|
205
|
right: 7px;
|
206
|
width: 7px;
|
207
|
content: @button-link-icon;
|
208
|
font-family: @button-link-font-family;
|
209
|
font-size: 12px;
|
210
|
line-height: @button-height;
|
211
|
}
|
212
|
|
213
|
&:after {
|
214
|
top: 50%;
|
215
|
right: 8px;
|
216
|
width: 12px;
|
217
|
height: 1px;
|
218
|
background: @button-link-color;
|
219
|
}
|
220
|
|
221
|
&:hover:before,
|
222
|
&:focus:before { right: 0; }
|
223
|
|
224
|
&:hover:after,
|
225
|
&:focus:after {
|
226
|
right: 0;
|
227
|
width: 20px;
|
228
|
}
|
229
|
|
230
|
}
|
231
|
|
232
|
}
|
233
|
|
234
|
|
235
|
// Size modifiers
|
236
|
// ========================================================================
|
237
|
|
238
|
.hook-button-large() {}
|
239
|
|
240
|
|
241
|
// Miscellaneous
|
242
|
// ========================================================================
|
243
|
|
244
|
.hook-button-misc() {
|
245
|
|
246
|
// Collapse border
|
247
|
.uk-button-group > .uk-button:nth-child(n+2),
|
248
|
.uk-button-group > div:nth-child(n+2) .uk-button { border-left-width: 0; }
|
249
|
|
250
|
.uk-button-group > .uk-button:nth-child(n+2):hover,
|
251
|
.uk-button-group > div:nth-child(n+2) .uk-button:hover,
|
252
|
.uk-button-group > .uk-button:nth-child(n+2):active,
|
253
|
.uk-button-group > .uk-button:nth-child(n+2).uk-active {
|
254
|
margin-left: -@button-border-width;
|
255
|
border-left-width: @button-border-width;
|
256
|
}
|
257
|
|
258
|
}
|