-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathn-tooltip.css
95 lines (92 loc) · 2.29 KB
/
n-tooltip.css
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
@charset "UTF-8";
/* niui – Tooltip */
.n-tooltip {
cursor: help;
}
.n-tooltip__icon {
display: inline-block;
border-radius: 0.5em;
min-width: 1em;
height: 1em;
text-align: center;
line-height: 1;
background-color: var(--nui-control-bg, #444);
}
.n-tooltip__icon:empty:after {
content: "?";
}
.n-tooltip__icon, .n-tooltip__content {
color: var(--nui-control-color, #ddd);
}
.n-tooltip__content {
overflow: hidden;
max-height: calc(100vh - 40px);
padding: calc(var(--line-height-em)/2);
font-size: 0.8em;
font-weight: normal;
position: absolute;
z-index: 999;
text-align: start;
transition: opacity 0.2s ease-in-out;
width: min(30em, 80vw);
line-height: calc(var(--line-height-em)/1.25);
padding: 2em;
box-sizing: border-box;
display: none;
}
.n-tooltip__content-visible {
display: block;
}
.n-tooltip__content:after {
content: "";
position: absolute;
background-color: var(--nui-control-bg, #444);
transform: rotate(45deg);
width: 1em;
height: 1em;
}
.n-tooltip__content:before {
content: "";
inset: 0;
position: absolute;
margin: 1em;
background: var(--nui-control-bg, #444);
border-radius: var(--nui-border-radius);
z-index: -1;
}
.n-tooltip__content:not([data-n-position=top]) {
-webkit-mask: linear-gradient(red, red) no-repeat;
-webkit-mask-size: 100% calc(100% - 1em);
mask: linear-gradient(red, red) no-repeat;
mask-size: 100% calc(100% - 1em);
}
.n-tooltip__content[data-n-position=top], .n-tooltip__content[data-n-position=bottom] {
margin-left: var(--offset_x, 0);
}
.n-tooltip__content[data-n-position=top]:after, .n-tooltip__content[data-n-position=bottom]:after {
left: calc(50% - 0.5em - var(--offset_x, 0));
bottom: 0.55em;
}
.n-tooltip__content[data-n-position=bottom]:after {
top: 0.55em;
}
.n-tooltip__content[data-n-position=left], .n-tooltip__content[data-n-position=right] {
margin-top: var(--offset_y, 0);
}
.n-tooltip__content[data-n-position=left]:after, .n-tooltip__content[data-n-position=right]:after {
top: calc(50% - 0.5em - var(--offset_y, 0));
left: 0.55em;
}
.n-tooltip__content[data-n-position=left]:after {
right: 0.55em;
left: auto;
}
body:has(> .n-tooltip__content) {
position: relative;
}
@-moz-document url-prefix() {
body {
position: relative;
}
}
/*# sourceMappingURL=n-tooltip.css.map */