@justeattakeaway/pie-tooltip 0.1.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +344 -15
- package/custom-elements.json +644 -3
- package/dist/index.d.ts +153 -2
- package/dist/index.js +390 -18
- package/dist/react.d.ts +159 -3
- package/dist/react.js +25 -7
- package/package.json +6 -4
- package/src/defs.ts +129 -3
- package/src/index.ts +691 -9
- package/src/react.ts +11 -3
- package/src/tooltip.scss +408 -2
package/src/react.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { createComponent } from '@lit/react';
|
|
2
|
+
import { createComponent, type EventName } from '@lit/react';
|
|
3
3
|
import { PieTooltip as PieTooltipLit } from './index';
|
|
4
4
|
import { type TooltipProps } from './defs';
|
|
5
5
|
|
|
@@ -10,10 +10,18 @@ const PieTooltipReact = createComponent({
|
|
|
10
10
|
elementClass: PieTooltipLit,
|
|
11
11
|
react: React,
|
|
12
12
|
tagName: 'pie-tooltip',
|
|
13
|
-
events: {
|
|
13
|
+
events: {
|
|
14
|
+
onPieTooltipOpen: 'pie-tooltip-open' as EventName<Event>, // When a configured trigger asks for the panel. Set `isOpen` to `true` in response.
|
|
15
|
+
onPieTooltipClose: 'pie-tooltip-close' as EventName<Event>, // When the close button is clicked, or a configured trigger asks to dismiss the panel. Set `isOpen` to `false` in response.
|
|
16
|
+
},
|
|
14
17
|
});
|
|
15
18
|
|
|
16
19
|
type ReactBaseType = React.HTMLAttributes<HTMLElement>
|
|
17
20
|
|
|
21
|
+
type PieTooltipEvents = {
|
|
22
|
+
onPieTooltipOpen?: (event: Event) => void;
|
|
23
|
+
onPieTooltipClose?: (event: Event) => void;
|
|
24
|
+
};
|
|
25
|
+
|
|
18
26
|
export const PieTooltip = PieTooltipReact as React.ForwardRefExoticComponent<React.PropsWithChildren<Omit<React.PropsWithoutRef<TooltipProps>, 'children'>>
|
|
19
|
-
& React.RefAttributes<PieTooltipLit> & ReactBaseType>;
|
|
27
|
+
& React.RefAttributes<PieTooltipLit> & PieTooltipEvents & ReactBaseType>;
|
package/src/tooltip.scss
CHANGED
|
@@ -1,7 +1,413 @@
|
|
|
1
1
|
@use '@justeattakeaway/pie-css/scss' as p;
|
|
2
2
|
|
|
3
|
+
// All twelve position values are generated explicitly — none inferred.
|
|
4
|
+
$tooltip-alignments: ('', '-start', '-end');
|
|
5
|
+
|
|
6
|
+
// Zero-size, pinned to the containing block's origin. Trigger position is measured relative
|
|
7
|
+
// to this point so the panel resolves against the document rather than the viewport.
|
|
8
|
+
|
|
3
9
|
:host {
|
|
4
|
-
|
|
5
|
-
|
|
10
|
+
--tooltip-anchor-top: 0;
|
|
11
|
+
--tooltip-anchor-left: 0;
|
|
12
|
+
--tooltip-anchor-width: 0;
|
|
13
|
+
--tooltip-anchor-height: 0;
|
|
14
|
+
--tooltip-container-inline-size: 0;
|
|
15
|
+
--tooltip-offset: var(--dt-spacing-a);
|
|
16
|
+
|
|
17
|
+
// Arrow protrusion depth; base is size × 2 (16px wide × 8px tall).
|
|
18
|
+
// Declared on the host so the placement layer can account for it.
|
|
19
|
+
--tooltip-arrow-size: 8px;
|
|
20
|
+
|
|
21
|
+
// Layer must clear both the offset and the arrow so the arrow tip doesn't touch the trigger.
|
|
22
|
+
--tooltip-layer-offset: calc(var(--tooltip-offset) + var(--tooltip-arrow-size));
|
|
23
|
+
|
|
24
|
+
position: absolute;
|
|
25
|
+
top: 0;
|
|
26
|
+
left: 0;
|
|
27
|
+
z-index: var(--dt-z-index-tooltip);
|
|
28
|
+
|
|
6
29
|
display: block;
|
|
30
|
+
|
|
31
|
+
inline-size: 0;
|
|
32
|
+
block-size: 0;
|
|
33
|
+
|
|
34
|
+
// Inherits to the anchor; the panel opts back in with `pointer-events: auto`.
|
|
35
|
+
pointer-events: none;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.c-tooltip-origin {
|
|
39
|
+
position: absolute;
|
|
40
|
+
top: 0;
|
|
41
|
+
left: 0;
|
|
42
|
+
|
|
43
|
+
inline-size: 0;
|
|
44
|
+
block-size: 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Sized and positioned to match the trigger; the placement layer resolves against this box.
|
|
48
|
+
.c-tooltip-anchor {
|
|
49
|
+
position: absolute;
|
|
50
|
+
top: var(--tooltip-anchor-top);
|
|
51
|
+
left: var(--tooltip-anchor-left);
|
|
52
|
+
|
|
53
|
+
inline-size: var(--tooltip-anchor-width);
|
|
54
|
+
block-size: var(--tooltip-anchor-height);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Grid so panel alignment uses logical start/center/end. A panel wider than its track overflows
|
|
58
|
+
// evenly from center, keeping it centred on the trigger.
|
|
59
|
+
.c-tooltip-layer {
|
|
60
|
+
position: absolute;
|
|
61
|
+
|
|
62
|
+
display: grid;
|
|
63
|
+
grid-template-columns: 100%;
|
|
64
|
+
grid-template-rows: 100%;
|
|
65
|
+
visibility: hidden;
|
|
66
|
+
transition: visibility 0s linear 150ms;
|
|
67
|
+
|
|
68
|
+
// `is-anchorVisible` is false when the trigger has been scrolled entirely out of a clipping
|
|
69
|
+
// ancestor: there is nothing left to point at, so the panel hides rather than float free.
|
|
70
|
+
&.is-open.is-positioned.is-anchorVisible {
|
|
71
|
+
visibility: visible;
|
|
72
|
+
transition-delay: 0s;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.c-tooltip-layer--type-icon {
|
|
77
|
+
--tooltip-layer-offset: var(--tooltip-offset);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@each $alignment in $tooltip-alignments {
|
|
81
|
+
.c-tooltip-layer--top#{$alignment},
|
|
82
|
+
.c-tooltip-layer--bottom#{$alignment} {
|
|
83
|
+
inset-inline-start: 0;
|
|
84
|
+
|
|
85
|
+
inline-size: 100%;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.c-tooltip-layer--left#{$alignment},
|
|
89
|
+
.c-tooltip-layer--right#{$alignment} {
|
|
90
|
+
inset-block-start: 0;
|
|
91
|
+
|
|
92
|
+
block-size: 100%;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.c-tooltip-layer--top#{$alignment} {
|
|
96
|
+
inset-block-end: calc(100% + var(--tooltip-layer-offset));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.c-tooltip-layer--bottom#{$alignment} {
|
|
100
|
+
inset-block-start: calc(100% + var(--tooltip-layer-offset));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// `left`/`right` resolve on the inline axis and swap in RTL. Their -start/-end alignments
|
|
104
|
+
// are on the block axis, which has no direction to mirror.
|
|
105
|
+
.c-tooltip-layer--left#{$alignment} {
|
|
106
|
+
inset-inline-end: calc(100% + var(--tooltip-layer-offset));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.c-tooltip-layer--right#{$alignment} {
|
|
110
|
+
inset-inline-start: calc(100% + var(--tooltip-layer-offset));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@each $side in (top, bottom, left, right) {
|
|
115
|
+
.c-tooltip-layer--#{$side} {
|
|
116
|
+
place-items: center;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.c-tooltip-layer--#{$side}-start {
|
|
120
|
+
place-items: start;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.c-tooltip-layer--#{$side}-end {
|
|
124
|
+
place-items: end;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.c-tooltip {
|
|
129
|
+
--tooltip-inline-size: 280px;
|
|
130
|
+
--tooltip-max-inline-size: calc(100vw - var(--dt-spacing-d) * 2);
|
|
131
|
+
--tooltip-background-color: var(--dt-color-container-inverse);
|
|
132
|
+
--tooltip-content-color: var(--dt-color-content-inverse);
|
|
133
|
+
--tooltip-border-radius: var(--dt-radius-rounded-b);
|
|
134
|
+
--tooltip-padding-block: var(--dt-spacing-b);
|
|
135
|
+
--tooltip-padding-inline: var(--dt-spacing-c);
|
|
136
|
+
--tooltip-close-size: 32px;
|
|
137
|
+
--tooltip-motion-duration: 150ms;
|
|
138
|
+
--tooltip-motion-easing: cubic-bezier(0.45, 0, 0.55, 1);
|
|
139
|
+
--tooltip-motion-translate-x: 0;
|
|
140
|
+
--tooltip-motion-translate-y: 0;
|
|
141
|
+
|
|
142
|
+
// Arrow centre offset from the aligned edge for -start/-end. Clear of the corner radius.
|
|
143
|
+
--tooltip-arrow-inset: calc(var(--tooltip-border-radius) + var(--tooltip-arrow-size));
|
|
144
|
+
|
|
145
|
+
// Centre position → box inset. Percentages resolve per axis, so one declaration covers both.
|
|
146
|
+
--tooltip-arrow-cross-inset: calc(var(--tooltip-arrow-cross-position, 50%) - var(--tooltip-arrow-size));
|
|
147
|
+
|
|
148
|
+
// 2px overlap into the panel prevents subpixel gaps between arrow and edge.
|
|
149
|
+
--tooltip-arrow-main-inset-far: calc(100% - 2px);
|
|
150
|
+
--tooltip-arrow-main-inset-near: calc(var(--tooltip-arrow-size) * -1);
|
|
151
|
+
|
|
152
|
+
@include p.font-theme('font-body-s');
|
|
153
|
+
|
|
154
|
+
position: relative;
|
|
155
|
+
|
|
156
|
+
inline-size: var(--tooltip-width, var(--tooltip-inline-size));
|
|
157
|
+
max-inline-size: var(--tooltip-max-inline-size);
|
|
158
|
+
padding-block-start: var(--tooltip-padding-block);
|
|
159
|
+
padding-block-end: var(--tooltip-padding-block);
|
|
160
|
+
padding-inline-start: var(--tooltip-padding-inline);
|
|
161
|
+
padding-inline-end: var(--tooltip-padding-inline);
|
|
162
|
+
border-radius: var(--tooltip-border-radius);
|
|
163
|
+
background-color: var(--tooltip-background-color);
|
|
164
|
+
color: var(--tooltip-content-color);
|
|
165
|
+
pointer-events: auto;
|
|
166
|
+
opacity: 0;
|
|
167
|
+
transform: translate(var(--tooltip-motion-translate-x), var(--tooltip-motion-translate-y));
|
|
168
|
+
transition:
|
|
169
|
+
opacity var(--tooltip-motion-duration) var(--tooltip-motion-easing),
|
|
170
|
+
transform var(--tooltip-motion-duration) var(--tooltip-motion-easing);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.c-tooltip-layer.is-open.is-positioned.is-anchorVisible .c-tooltip {
|
|
174
|
+
--tooltip-motion-duration: 200ms;
|
|
175
|
+
|
|
176
|
+
opacity: 1;
|
|
177
|
+
transform: translate(0, 0);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
@each $alignment in $tooltip-alignments {
|
|
181
|
+
.c-tooltip--top#{$alignment} {
|
|
182
|
+
--tooltip-motion-translate-y: 4px;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.c-tooltip--bottom#{$alignment} {
|
|
186
|
+
--tooltip-motion-translate-y: -4px;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.c-tooltip--left#{$alignment} {
|
|
190
|
+
--tooltip-motion-translate-x: 4px;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.c-tooltip--right#{$alignment} {
|
|
194
|
+
--tooltip-motion-translate-x: -4px;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// Transforms are physical; logical left/right need their translate flipped in RTL.
|
|
199
|
+
:host(:dir(rtl)) {
|
|
200
|
+
@each $alignment in $tooltip-alignments {
|
|
201
|
+
.c-tooltip--left#{$alignment} {
|
|
202
|
+
--tooltip-motion-translate-x: -4px;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.c-tooltip--right#{$alignment} {
|
|
206
|
+
--tooltip-motion-translate-x: 4px;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
@media (prefers-reduced-motion: reduce) {
|
|
212
|
+
.c-tooltip-layer,
|
|
213
|
+
.c-tooltip {
|
|
214
|
+
transition: none;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.c-tooltip--inverse {
|
|
219
|
+
--tooltip-background-color: var(--dt-color-container-default);
|
|
220
|
+
--tooltip-content-color: var(--dt-color-content-default);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.c-tooltip--size-fit-to-content {
|
|
224
|
+
--tooltip-inline-size: max-content;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.c-tooltip--size-fill-container {
|
|
228
|
+
--tooltip-inline-size: var(--tooltip-container-inline-size);
|
|
229
|
+
--tooltip-max-inline-size: none;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// Also declares inline-size to prevent `--tooltip-width` from overriding it.
|
|
233
|
+
.c-tooltip--type-icon {
|
|
234
|
+
--tooltip-border-radius: var(--dt-radius-rounded-e);
|
|
235
|
+
--tooltip-padding-block: var(--dt-spacing-a);
|
|
236
|
+
--tooltip-padding-inline: var(--dt-spacing-c);
|
|
237
|
+
|
|
238
|
+
inline-size: max-content;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.c-tooltip.is-dismissible {
|
|
242
|
+
// The close button is taller than one content line; reserve its block size.
|
|
243
|
+
min-block-size: calc(var(--tooltip-close-size) + var(--dt-spacing-b) * 2);
|
|
244
|
+
padding-inline-end: calc(var(--tooltip-padding-inline) + var(--tooltip-close-size));
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.c-tooltip.is-dismissible:not(.has-heading) {
|
|
248
|
+
display: flex;
|
|
249
|
+
flex-direction: column;
|
|
250
|
+
justify-content: center;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// Arrow: clip-path triangle, 16px wide × 8px tall. Both insets are logical so the arrow
|
|
254
|
+
// follows the panel when left/right swap in RTL.
|
|
255
|
+
@mixin tooltip-arrow-clip($direction) {
|
|
256
|
+
@if $direction == up {
|
|
257
|
+
inline-size: calc(var(--tooltip-arrow-size) * 2);
|
|
258
|
+
block-size: calc(var(--tooltip-arrow-size) + 2px);
|
|
259
|
+
clip-path: polygon(50% 0%, 100% var(--tooltip-arrow-size), 100% 100%, 0% 100%, 0% var(--tooltip-arrow-size));
|
|
260
|
+
} @else if $direction == down {
|
|
261
|
+
inline-size: calc(var(--tooltip-arrow-size) * 2);
|
|
262
|
+
block-size: calc(var(--tooltip-arrow-size) + 2px);
|
|
263
|
+
clip-path: polygon(0% 0%, 100% 0%, 100% 2px, 50% 100%, 0% 2px);
|
|
264
|
+
} @else if $direction == left {
|
|
265
|
+
inline-size: calc(var(--tooltip-arrow-size) + 2px);
|
|
266
|
+
block-size: calc(var(--tooltip-arrow-size) * 2);
|
|
267
|
+
clip-path: polygon(0% 50%, var(--tooltip-arrow-size) 0%, 100% 0%, 100% 100%, var(--tooltip-arrow-size) 100%);
|
|
268
|
+
} @else if $direction == right {
|
|
269
|
+
inline-size: calc(var(--tooltip-arrow-size) + 2px);
|
|
270
|
+
block-size: calc(var(--tooltip-arrow-size) * 2);
|
|
271
|
+
clip-path: polygon(0% 0%, 2px 0%, 100% 50%, 2px 100%, 0% 100%);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
@each $side in (top, bottom, left, right) {
|
|
276
|
+
.c-tooltip--#{$side} {
|
|
277
|
+
--tooltip-arrow-cross-position: 50%;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.c-tooltip--#{$side}-start {
|
|
281
|
+
--tooltip-arrow-cross-position: var(--tooltip-arrow-inset);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.c-tooltip--#{$side}-end {
|
|
285
|
+
--tooltip-arrow-cross-position: calc(100% - var(--tooltip-arrow-inset));
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.c-tooltip-arrow {
|
|
290
|
+
position: absolute;
|
|
291
|
+
|
|
292
|
+
background-color: var(--tooltip-background-color);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
@each $alignment in $tooltip-alignments {
|
|
296
|
+
.c-tooltip--top#{$alignment} .c-tooltip-arrow {
|
|
297
|
+
@include tooltip-arrow-clip(down);
|
|
298
|
+
|
|
299
|
+
inset-block-start: var(--tooltip-arrow-main-inset-far);
|
|
300
|
+
inset-inline-start: var(--tooltip-arrow-cross-inset);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.c-tooltip--bottom#{$alignment} .c-tooltip-arrow {
|
|
304
|
+
@include tooltip-arrow-clip(up);
|
|
305
|
+
|
|
306
|
+
inset-block-start: var(--tooltip-arrow-main-inset-near);
|
|
307
|
+
inset-inline-start: var(--tooltip-arrow-cross-inset);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.c-tooltip--left#{$alignment} .c-tooltip-arrow {
|
|
311
|
+
@include tooltip-arrow-clip(right);
|
|
312
|
+
|
|
313
|
+
inset-block-start: var(--tooltip-arrow-cross-inset);
|
|
314
|
+
inset-inline-start: var(--tooltip-arrow-main-inset-far);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.c-tooltip--right#{$alignment} .c-tooltip-arrow {
|
|
318
|
+
@include tooltip-arrow-clip(left);
|
|
319
|
+
|
|
320
|
+
inset-block-start: var(--tooltip-arrow-cross-inset);
|
|
321
|
+
inset-inline-start: var(--tooltip-arrow-main-inset-near);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
// clip-path is physical; scaleX(-1) flips left/right arrows to face the correct way in RTL.
|
|
326
|
+
:host(:dir(rtl)) {
|
|
327
|
+
@each $alignment in $tooltip-alignments {
|
|
328
|
+
.c-tooltip--left#{$alignment} .c-tooltip-arrow,
|
|
329
|
+
.c-tooltip--right#{$alignment} .c-tooltip-arrow {
|
|
330
|
+
transform: scaleX(-1);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.c-tooltip-heading {
|
|
336
|
+
@include p.font-theme('font-body-strong-s');
|
|
337
|
+
|
|
338
|
+
margin-block-start: 0;
|
|
339
|
+
margin-block-end: 0;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.c-tooltip-content {
|
|
343
|
+
overflow-wrap: break-word;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.c-tooltip.has-action .c-tooltip-action {
|
|
347
|
+
display: flex;
|
|
348
|
+
justify-content: flex-end;
|
|
349
|
+
margin-block-start: var(--dt-spacing-a);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.c-tooltip.is-dismissible.has-action .c-tooltip-action {
|
|
353
|
+
margin-inline-end: calc(var(--tooltip-close-size) * -1);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
// Close button is out of flow; reserving its block size on the body aligns the action row with it.
|
|
357
|
+
.c-tooltip.is-dismissible.has-action .c-tooltip-body {
|
|
358
|
+
min-block-size: var(--tooltip-close-size);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
// No heading means one content line; keep it centred against the close button.
|
|
362
|
+
.c-tooltip.is-dismissible.has-action:not(.has-heading) .c-tooltip-body {
|
|
363
|
+
display: grid;
|
|
364
|
+
align-content: center;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.c-tooltip-close {
|
|
368
|
+
position: absolute;
|
|
369
|
+
inset-block-start: var(--dt-spacing-b);
|
|
370
|
+
inset-inline-end: var(--dt-spacing-b);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
// Hover bridge: a transparent pseudo-element extending from each panel edge toward its
|
|
374
|
+
// trigger, covering the --tooltip-layer-offset gap. Keeps the hover region intact so
|
|
375
|
+
// the pointer can travel from the trigger into the panel without the close timer firing.
|
|
376
|
+
// Sized from --tooltip-layer-offset so widening --tooltip-offset cannot open a hole.
|
|
377
|
+
@each $alignment in $tooltip-alignments {
|
|
378
|
+
.c-tooltip--top#{$alignment}::before {
|
|
379
|
+
content: '';
|
|
380
|
+
position: absolute;
|
|
381
|
+
inset-block-start: 100%;
|
|
382
|
+
block-size: var(--tooltip-layer-offset);
|
|
383
|
+
inset-inline-start: 0;
|
|
384
|
+
inline-size: 100%;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.c-tooltip--bottom#{$alignment}::before {
|
|
388
|
+
content: '';
|
|
389
|
+
position: absolute;
|
|
390
|
+
inset-block-end: 100%;
|
|
391
|
+
block-size: var(--tooltip-layer-offset);
|
|
392
|
+
inset-inline-start: 0;
|
|
393
|
+
inline-size: 100%;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.c-tooltip--left#{$alignment}::before {
|
|
397
|
+
content: '';
|
|
398
|
+
position: absolute;
|
|
399
|
+
inset-inline-start: 100%;
|
|
400
|
+
inline-size: var(--tooltip-layer-offset);
|
|
401
|
+
inset-block-start: 0;
|
|
402
|
+
block-size: 100%;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
.c-tooltip--right#{$alignment}::before {
|
|
406
|
+
content: '';
|
|
407
|
+
position: absolute;
|
|
408
|
+
inset-inline-end: 100%;
|
|
409
|
+
inline-size: var(--tooltip-layer-offset);
|
|
410
|
+
inset-block-start: 0;
|
|
411
|
+
block-size: 100%;
|
|
412
|
+
}
|
|
7
413
|
}
|