Skip to content

Commit b4d1846

Browse files
committed
v2.0 release
1 parent a8cc012 commit b4d1846

File tree

3 files changed

+38
-63
lines changed

3 files changed

+38
-63
lines changed

dist/scss/simple-hint.scss

+31-56
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,20 @@
3434
}
3535
}
3636

37-
$def: #292929;
3837

3938

39+
$default-color: #292929;
40+
4041
[simple-hint] {
4142
&:after, &:before {
4243
display: inline-block;
4344
pointer-events: none;
4445
position: absolute;
45-
46-
// opacity: 0;
4746
visibility: hidden;
4847
}
4948

5049
&:hover {
5150
&:after, &:before {
52-
// opacity: 1;
5351
visibility: visible;
5452
}
5553
}
@@ -64,21 +62,19 @@ $def: #292929;
6462
content: attr(simple-hint);
6563
text-align: center;
6664
padding: 3px 7px;
67-
font-size: 1.2rem;
68-
line-height: 2em;
6965
border-radius: 2px;
7066
z-index: 9999;
7167
color: white;
7268
font-weight: 400;
73-
74-
// word-wrap: break-word;
7569
white-space: nowrap;
76-
// white-space: pre;
70+
font-size: 1.2rem;
71+
line-height: 2em;
7772

78-
background: $def;
73+
background: $default-color;
7974
}
8075
}
8176

77+
// ---- positioning ----
8278
[class*="hint-bottom"], [class*="hint-top"] {
8379
&:before {
8480
right: 50%;
@@ -89,35 +85,26 @@ $def: #292929;
8985
@include transform( translateX(-50%));
9086
}
9187
}
92-
9388
[class*="hint-bottom"] {
9489
&:before {
95-
border-bottom-color: $def;
96-
// bottom: -10px;
90+
border-bottom-color: $default-color;
9791
top: 100%;
9892
}
9993
&:after {
10094
margin-top: 10px;
10195
top: 100%;
10296
}
10397
}
104-
10598
[class*="hint-top"] {
10699
&:before {
107-
border-top-color: $def;
108-
// top: -10px;
100+
border-top-color: $default-color;
109101
bottom: 100%;
110102
}
111103
&:after {
112104
bottom: 100%;
113105
margin-bottom: 10px;
114-
// bottom: 100%;
115-
// margin-bottom: 10px;
116-
117106
}
118107
}
119-
120-
121108
[class*="hint-left"], [class*="hint-right"] {
122109
&:before {
123110
top: 50%;
@@ -128,48 +115,50 @@ $def: #292929;
128115
@include transform(translateY(-50%));
129116
}
130117
}
131-
132118
[class*="hint-left"] {
133119
&:before {
134-
border-left-color: $def;
120+
border-left-color: $default-color;
135121
left: 0;
136122
margin-left: -10px;
137123
}
138124
&:after {
139-
// left: -100%;
140-
// @include transform(translate(50%, -50%));
141125
right: 100%;
142126
margin-right: 10px;
143-
// left: 0;
144-
// transform: translate(-100%, -50%);
145-
146127
}
147128
}
148-
149129
[class*="hint-right"] {
150130
&:before {
151-
border-right-color: $def;
131+
border-right-color: $default-color;
152132
right: 0;
153133
margin-right: -10px;
154-
// left: 100%;
155134
}
156135
&:after {
157136
left: 100%;
158137
margin-left: 10px;
159-
160-
161138
}
162139
}
163140

164141

165-
// persist
142+
// ---- persist ----
166143
.hint-persist {
167144
&:before, &:after {
168145
visibility: visible;
169146
}
170147
}
171148

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 ----
173162
[class*="hint-"][class*="-s-small"]:after {
174163
width: 200px;
175164
white-space: initial;
@@ -184,7 +173,7 @@ $def: #292929;
184173
}
185174

186175

187-
// delay on default hints
176+
// ---- delay on default hints ----
188177
.hint-d-short {
189178
&:hover:after, &:hover:before {
190179
@include transition(visibility 0s 0.5s ease);
@@ -202,9 +191,9 @@ $def: #292929;
202191
}
203192

204193

205-
206-
// opacity fade + delay
194+
// ---- fade in + delay ----
207195
[class*="hint-fade"] {
196+
// fade in transition
208197
&:before, &:after {
209198
@include transition(opacity 0.5s ease);
210199
opacity: 0;
@@ -234,13 +223,12 @@ $def: #292929;
234223
}
235224

236225

237-
// animation keyframes
226+
// ---- animation keyframes ----
238227
@include keyframes(top){
239228
from {
240229
bottom: 125%;
241230
opacity: 0;
242231
}
243-
244232
}
245233
@include keyframes(bottom){
246234
from {
@@ -263,14 +251,15 @@ $def: #292929;
263251
}
264252
}
265253

266-
// animation + delay
254+
// ---- animation + delay ----
267255
[class*="hint-anim"] {
268256
&:after, &:before {
269257
@include prefix(animation-fill-mode, both);
270258
@include prefix(animation-duration, 0.3s);
271259
@include prefix(animation-timing-function, ease);
272260
}
273261

262+
// animation
274263
&[class*="hint-top"] {
275264
&:hover:before, &:hover:after {
276265
@include prefix(animation-name, top);
@@ -311,23 +300,12 @@ $def: #292929;
311300
}
312301

313302

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----
325304
$info: #44C2F9;
326305
$success: #83C510;
327306
$error: #FF4C4C;
328307
$notice: #FFAE00;
329308

330-
// types
331309
[class*="hint-"][class*="-t-info"] {
332310
&[class*="hint-bottom"]:before{
333311
border-bottom-color: $info;
@@ -345,7 +323,6 @@ $notice: #FFAE00;
345323
background: $info;
346324
}
347325
}
348-
349326
[class*="hint-"][class*="-t-success"] {
350327
&[class*="hint-bottom"]:before{
351328
border-bottom-color: $success;
@@ -363,7 +340,6 @@ $notice: #FFAE00;
363340
background: $success;
364341
}
365342
}
366-
367343
[class*="hint-"][class*="-t-error"] {
368344
&[class*="hint-bottom"]:before{
369345
border-bottom-color: $error;
@@ -381,7 +357,6 @@ $notice: #FFAE00;
381357
background: $error;
382358
}
383359
}
384-
385360
[class*="hint-"][class*="-t-notice"] {
386361
&[class*="hint-bottom"]:before{
387362
border-bottom-color: $notice;

dist/simple-hint.css

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
content: attr(simple-hint);
1515
text-align: center;
1616
padding: 3px 7px;
17-
font-size: 1.2rem;
18-
line-height: 2em;
1917
border-radius: 2px;
2018
z-index: 9999;
2119
color: white;
2220
font-weight: 400;
2321
white-space: nowrap;
22+
font-size: 1.2rem;
23+
line-height: 2em;
2424
background: #292929; }
2525

2626
[class*="hint-bottom"]:before, [class*="hint-top"]:before {
@@ -76,6 +76,10 @@
7676
.hint-persist:before, .hint-persist:after {
7777
visibility: visible; }
7878

79+
@media only screen and (max-width: 768px) {
80+
[class*="hint-"][class*="-mobile"]:after, [class*="hint-"][class*="-mobile"]:before {
81+
display: none; } }
82+
7983
[class*="hint-"][class*="-s-small"]:after {
8084
width: 200px;
8185
white-space: initial; }
@@ -228,10 +232,6 @@
228232
-moz-animation-delay: 2s;
229233
animation-delay: 2s; }
230234

231-
@media only screen and (max-width: 768px) {
232-
[class*="hint-"][class*="-mobile"]:after, [class*="hint-"][class*="-mobile"]:before {
233-
display: none; } }
234-
235235
[class*="hint-"][class*="-t-info"][class*="hint-bottom"]:before {
236236
border-bottom-color: #44C2F9; }
237237
[class*="hint-"][class*="-t-info"][class*="hint-top"]:before {

dist/simple-hint.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)