34
34
}
35
35
}
36
36
37
- $def : #292929 ;
38
37
39
38
39
+ $default-color : #292929 ;
40
+
40
41
[simple-hint ] {
41
42
& :after , & :before {
42
43
display : inline-block ;
43
44
pointer-events : none ;
44
45
position : absolute ;
45
-
46
- // opacity: 0;
47
46
visibility : hidden ;
48
47
}
49
48
50
49
& :hover {
51
50
& :after , & :before {
52
- // opacity: 1;
53
51
visibility : visible ;
54
52
}
55
53
}
@@ -64,21 +62,19 @@ $def: #292929;
64
62
content : attr (simple-hint );
65
63
text-align : center ;
66
64
padding : 3px 7px ;
67
- font-size : 1.2rem ;
68
- line-height : 2em ;
69
65
border-radius : 2px ;
70
66
z-index : 9999 ;
71
67
color : white ;
72
68
font-weight : 400 ;
73
-
74
- // word-wrap: break-word;
75
69
white-space : nowrap ;
76
- // white-space: pre;
70
+ font-size : 1.2rem ;
71
+ line-height : 2em ;
77
72
78
- background : $def ;
73
+ background : $default-color ;
79
74
}
80
75
}
81
76
77
+ // ---- positioning ----
82
78
[class *= " hint-bottom" ], [class *= " hint-top" ] {
83
79
& :before {
84
80
right : 50% ;
@@ -89,35 +85,26 @@ $def: #292929;
89
85
@include transform ( translateX (-50% ));
90
86
}
91
87
}
92
-
93
88
[class *= " hint-bottom" ] {
94
89
& :before {
95
- border-bottom-color : $def ;
96
- // bottom: -10px;
90
+ border-bottom-color : $default-color ;
97
91
top : 100% ;
98
92
}
99
93
& :after {
100
94
margin-top : 10px ;
101
95
top : 100% ;
102
96
}
103
97
}
104
-
105
98
[class *= " hint-top" ] {
106
99
& :before {
107
- border-top-color : $def ;
108
- // top: -10px;
100
+ border-top-color : $default-color ;
109
101
bottom : 100% ;
110
102
}
111
103
& :after {
112
104
bottom : 100% ;
113
105
margin-bottom : 10px ;
114
- // bottom: 100%;
115
- // margin-bottom: 10px;
116
-
117
106
}
118
107
}
119
-
120
-
121
108
[class *= " hint-left" ], [class *= " hint-right" ] {
122
109
& :before {
123
110
top : 50% ;
@@ -128,48 +115,50 @@ $def: #292929;
128
115
@include transform (translateY (-50% ));
129
116
}
130
117
}
131
-
132
118
[class *= " hint-left" ] {
133
119
& :before {
134
- border-left-color : $def ;
120
+ border-left-color : $default-color ;
135
121
left : 0 ;
136
122
margin-left : -10px ;
137
123
}
138
124
& :after {
139
- // left: -100%;
140
- // @include transform(translate(50%, -50%));
141
125
right : 100% ;
142
126
margin-right : 10px ;
143
- // left: 0;
144
- // transform: translate(-100%, -50%);
145
-
146
127
}
147
128
}
148
-
149
129
[class *= " hint-right" ] {
150
130
& :before {
151
- border-right-color : $def ;
131
+ border-right-color : $default-color ;
152
132
right : 0 ;
153
133
margin-right : -10px ;
154
- // left: 100%;
155
134
}
156
135
& :after {
157
136
left : 100% ;
158
137
margin-left : 10px ;
159
-
160
-
161
138
}
162
139
}
163
140
164
141
165
- // persist
142
+ // ---- persist ----
166
143
.hint-persist {
167
144
& :before , & :after {
168
145
visibility : visible ;
169
146
}
170
147
}
171
148
172
- // sizing
149
+
150
+ // ---- mobile ----
151
+ [class *= " hint-" ][class *= " -mobile" ] {
152
+ & :after , & :before {
153
+ @media only screen and (max-width : 768px ) {
154
+ display : none ;
155
+ }
156
+
157
+ }
158
+ }
159
+
160
+
161
+ // ---- sizing ----
173
162
[class *= " hint-" ][class *= " -s-small" ]:after {
174
163
width : 200px ;
175
164
white-space : initial ;
@@ -184,7 +173,7 @@ $def: #292929;
184
173
}
185
174
186
175
187
- // delay on default hints
176
+ // ---- delay on default hints ----
188
177
.hint-d-short {
189
178
& :hover :after , & :hover :before {
190
179
@include transition (visibility 0s 0.5s ease );
@@ -202,9 +191,9 @@ $def: #292929;
202
191
}
203
192
204
193
205
-
206
- // opacity fade + delay
194
+ // ---- fade in + delay ----
207
195
[class *= " hint-fade" ] {
196
+ // fade in transition
208
197
& :before , & :after {
209
198
@include transition (opacity 0.5s ease );
210
199
opacity : 0 ;
@@ -234,13 +223,12 @@ $def: #292929;
234
223
}
235
224
236
225
237
- // animation keyframes
226
+ // ---- animation keyframes ----
238
227
@include keyframes (top ){
239
228
from {
240
229
bottom : 125% ;
241
230
opacity : 0 ;
242
231
}
243
-
244
232
}
245
233
@include keyframes (bottom ){
246
234
from {
@@ -263,14 +251,15 @@ $def: #292929;
263
251
}
264
252
}
265
253
266
- // animation + delay
254
+ // ---- animation + delay ----
267
255
[class *= " hint-anim" ] {
268
256
& :after , & :before {
269
257
@include prefix (animation-fill-mode , both );
270
258
@include prefix (animation-duration , 0.3s );
271
259
@include prefix (animation-timing-function , ease );
272
260
}
273
261
262
+ // animation
274
263
& [class *= " hint-top" ] {
275
264
& :hover :before , & :hover :after {
276
265
@include prefix (animation-name , top );
@@ -311,23 +300,12 @@ $def: #292929;
311
300
}
312
301
313
302
314
- // mobile
315
- [class *= " hint-" ][class *= " -mobile" ] {
316
- & :after , & :before {
317
- @media only screen and (max-width : 768px ) {
318
- display : none ;
319
- }
320
-
321
- }
322
- }
323
-
324
-
303
+ // ---- color types----
325
304
$info : #44C2F9 ;
326
305
$success : #83C510 ;
327
306
$error : #FF4C4C ;
328
307
$notice : #FFAE00 ;
329
308
330
- // types
331
309
[class *= " hint-" ][class *= " -t-info" ] {
332
310
& [class *= " hint-bottom" ]:before {
333
311
border-bottom-color : $info ;
@@ -345,7 +323,6 @@ $notice: #FFAE00;
345
323
background : $info ;
346
324
}
347
325
}
348
-
349
326
[class *= " hint-" ][class *= " -t-success" ] {
350
327
& [class *= " hint-bottom" ]:before {
351
328
border-bottom-color : $success ;
@@ -363,7 +340,6 @@ $notice: #FFAE00;
363
340
background : $success ;
364
341
}
365
342
}
366
-
367
343
[class *= " hint-" ][class *= " -t-error" ] {
368
344
& [class *= " hint-bottom" ]:before {
369
345
border-bottom-color : $error ;
@@ -381,7 +357,6 @@ $notice: #FFAE00;
381
357
background : $error ;
382
358
}
383
359
}
384
-
385
360
[class *= " hint-" ][class *= " -t-notice" ] {
386
361
& [class *= " hint-bottom" ]:before {
387
362
border-bottom-color : $notice ;
0 commit comments