12.tip {3 position: relative;4 width: 360px;5 margin: 0;6 color: #1b1b1b;7 font: 20px/1.5 ui-serif, Georgia, "Times New Roman", serif;8}9.tip *, .tip *::before, .tip *::after {10 box-sizing: border-box;11}12.tip__ref {13 position: relative;14 display: inline-block;15}16.tip__btn {17 display: inline-grid;18 place-items: center;19 width: 18px;20 height: 18px;21 margin-left: 2px;22 padding: 0;23 border: 0;24 border-radius: 50%;25 background: #6e1f2a;26 color: #f3ece0;27 font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;28 vertical-align: super;29 cursor: help;30 transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s;31}32.tip__ref:hover .tip__btn, .tip__btn:focus-visible {33 background: #1b1b1b;34 transform: scale(1.2);35}36.tip__btn:focus-visible {37 outline: 2px solid #6e1f2a;38 outline-offset: 2px;39}40.tip__note {41 position: absolute;42 left: 50%;43 bottom: calc(100% - 4px);44 z-index: 2;45 width: 232px;46 margin-left: -116px;47 padding: 10px 12px 11px;48 border-top: 3px solid #6e1f2a;49 border-radius: 2px 2px 6px 6px;50 background: #1b1b1b;51 color: #f3ece0;52 font: 12.5px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;53 text-align: left;54 box-shadow: 0 12px 24px -10px rgba(27, 27, 27, 0.5);55 opacity: 0;56 pointer-events: none;57 clip-path: inset(100% 0 0 0);58 transform: translateY(6px);59 transition: clip-path 0.3s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.2s, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);60}61.tip__ref--end .tip__note {62 left: auto;63 right: -10px;64 margin-left: 0;65}66.tip__ref:hover .tip__note, .tip__btn:focus-visible + .tip__note {67 opacity: 1;68 pointer-events: auto;69 clip-path: inset(0 0 -20px 0);70 transform: translateY(0);71}72@media (prefers-reduced-motion: reduce) {73 .tip__note, .tip__btn {74 transition: opacity 0.15s;75 }76}
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
.tip {
position: relative;
width: 360px;
margin: 0;
color: #1b1b1b;
font: 20px/1.5 ui-serif, Georgia, "Times New Roman", serif;
}
.tip *, .tip *::before, .tip *::after {
box-sizing: border-box;
}
.tip__ref {
position: relative;
display: inline-block;
}
.tip__btn {
display: inline-grid;
place-items: center;
width: 18px;
height: 18px;
margin-left: 2px;
padding: 0;
border: 0;
border-radius: 50%;
background: #6e1f2a;
color: #f3ece0;
font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
vertical-align: super;
cursor: help;
transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s;
}
.tip__ref:hover .tip__btn, .tip__btn:focus-visible {
background: #1b1b1b;
transform: scale(1.2);
}
.tip__btn:focus-visible {
outline: 2px solid #6e1f2a;
outline-offset: 2px;
}
.tip__note {
position: absolute;
left: 50%;
bottom: calc(100% - 4px);
z-index: 2;
width: 232px;
margin-left: -116px;
padding: 10px 12px 11px;
border-top: 3px solid #6e1f2a;
border-radius: 2px 2px 6px 6px;
background: #1b1b1b;
color: #f3ece0;
font: 12.5px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
text-align: left;
box-shadow: 0 12px 24px -10px rgba(27, 27, 27, 0.5);
opacity: 0;
pointer-events: none;
clip-path: inset(100% 0 0 0);
transform: translateY(6px);
transition: clip-path 0.3s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.2s, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tip__ref--end .tip__note {
left: auto;
right: -10px;
margin-left: 0;
}
.tip__ref:hover .tip__note, .tip__btn:focus-visible + .tip__note {
opacity: 1;
pointer-events: auto;
clip-path: inset(0 0 -20px 0);
transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
.tip__note, .tip__btn {
transition: opacity 0.15s;
}
}
You need to sign in before you can write a comment.