@carbon/styles 0.8.0-rc.0 → 0.10.0-rc.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/package.json +9 -9
- package/scss/_feature-flags.scss +8 -1
- package/scss/components/button/_button.scss +2 -112
- package/scss/components/button/_tokens.scss +2 -2
- package/scss/components/checkbox/_checkbox.scss +3 -0
- package/scss/components/code-snippet/_code-snippet.scss +3 -3
- package/scss/components/data-table/_data-table.scss +1 -0
- package/scss/components/data-table/expandable/_data-table-expandable.scss +2 -2
- package/scss/components/date-picker/_date-picker.scss +1 -1
- package/scss/components/date-picker/_flatpickr.scss +39 -38
- package/scss/components/dropdown/_dropdown.scss +4 -4
- package/scss/components/form/_form.scss +7 -4
- package/scss/components/list-box/_list-box.scss +4 -4
- package/scss/components/notification/_inline-notification.scss +2 -2
- package/scss/components/notification/_toast-notification.scss +3 -3
- package/scss/components/number-input/_number-input.scss +3 -3
- package/scss/components/overflow-menu/_overflow-menu.scss +5 -4
- package/scss/components/popover/_popover.scss +241 -199
- package/scss/components/radio-button/_radio-button.scss +11 -9
- package/scss/components/search/_search.scss +7 -7
- package/scss/components/structured-list/_structured-list.scss +3 -3
- package/scss/components/tabs/_tabs.scss +111 -551
- package/scss/components/tile/_tile.scss +4 -3
- package/scss/components/toggle/_toggle.scss +80 -18
- package/scss/components/tooltip/_index.scss +1 -0
- package/scss/components/tooltip/_tooltip.scss +38 -725
- package/scss/components/treeview/_treeview.scss +17 -17
|
@@ -5,743 +5,56 @@
|
|
|
5
5
|
// LICENSE file in the root directory of this source tree.
|
|
6
6
|
//
|
|
7
7
|
|
|
8
|
-
@use '../../theme' as *;
|
|
9
|
-
@use '../../type';
|
|
10
|
-
@use '../../motion' as *;
|
|
11
8
|
@use '../../config' as *;
|
|
12
|
-
@use '../../spacing'
|
|
13
|
-
@use '
|
|
14
|
-
@use '../../
|
|
15
|
-
@use '../../utilities/
|
|
16
|
-
@use '../../utilities/
|
|
17
|
-
@use '../../utilities/tooltip' as *;
|
|
18
|
-
@use '../../utilities/button-reset';
|
|
19
|
-
@use '../../utilities/high-contrast-mode' as *;
|
|
20
|
-
@use '../../utilities/skeleton' as *;
|
|
21
|
-
@use '../../utilities/convert' as *;
|
|
22
|
-
@use '../../utilities/box-shadow' as *;
|
|
23
|
-
|
|
24
|
-
// TODO: deprecate legacy tooltip mixins
|
|
25
|
-
// Tooltip Icon
|
|
26
|
-
// Icon CSS only tooltip
|
|
27
|
-
/// @access private
|
|
28
|
-
/// @deprecated
|
|
29
|
-
/// @group tooltip
|
|
30
|
-
@mixin tooltip--icon {
|
|
31
|
-
@include reset;
|
|
32
|
-
|
|
33
|
-
position: relative;
|
|
34
|
-
display: inline-flex;
|
|
35
|
-
overflow: visible;
|
|
36
|
-
align-items: center;
|
|
37
|
-
cursor: pointer;
|
|
38
|
-
|
|
39
|
-
// Tooltip - renders as a combo of ::before and ::after elements
|
|
40
|
-
&::before,
|
|
41
|
-
&::after {
|
|
42
|
-
@include type.type-style('body-short-01');
|
|
43
|
-
|
|
44
|
-
position: absolute;
|
|
45
|
-
display: flex;
|
|
46
|
-
align-items: center;
|
|
47
|
-
opacity: 0;
|
|
48
|
-
pointer-events: none;
|
|
49
|
-
transition: opacity $duration-fast-01 motion(standard, productive);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
&::before {
|
|
53
|
-
right: 0;
|
|
54
|
-
left: 0;
|
|
55
|
-
width: 0;
|
|
56
|
-
height: 0;
|
|
57
|
-
border-width: 0 rem(4px) rem(5px) rem(4px);
|
|
58
|
-
border-style: solid;
|
|
59
|
-
border-color: transparent transparent $background-inverse transparent;
|
|
60
|
-
margin: 0 auto;
|
|
61
|
-
margin-top: 1px;
|
|
62
|
-
margin-left: 50%;
|
|
63
|
-
content: '';
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
&::after {
|
|
67
|
-
@include box-shadow;
|
|
68
|
-
|
|
69
|
-
min-width: rem(24px);
|
|
70
|
-
max-width: rem(208px);
|
|
71
|
-
height: rem(24px);
|
|
72
|
-
padding: 0 1rem;
|
|
73
|
-
margin-left: 50%;
|
|
74
|
-
background-color: $background-inverse;
|
|
75
|
-
border-radius: rem(2px);
|
|
76
|
-
color: $text-inverse;
|
|
77
|
-
content: attr(aria-label);
|
|
78
|
-
font-weight: 400;
|
|
79
|
-
pointer-events: none;
|
|
80
|
-
transform: translateX(-50%);
|
|
81
|
-
white-space: nowrap;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
&:hover,
|
|
85
|
-
&:focus {
|
|
86
|
-
&::before,
|
|
87
|
-
&::after {
|
|
88
|
-
opacity: 1;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// Tooltip Icon caret - top position
|
|
94
|
-
/// @param {String} $position ['bottom'] - The position, from: `top`, `bottom`
|
|
95
|
-
/// @param {String} $align ['center'] - The alignment, from: `start`, `center`, `end`
|
|
96
|
-
/// @access private
|
|
97
|
-
/// @deprecated
|
|
98
|
-
/// @group tooltip
|
|
99
|
-
@mixin tooltip--icon-placement($position: 'bottom', $align: 'center') {
|
|
100
|
-
$translate-x: if($align == 'center', -50%, 0);
|
|
101
|
-
$translate-y-caret: if($position == 'top', calc(-100% - 9px), 10px);
|
|
102
|
-
$translate-y-body: if(
|
|
103
|
-
$position == 'top',
|
|
104
|
-
calc(-100% - 12px),
|
|
105
|
-
calc(100% + 10px)
|
|
106
|
-
);
|
|
107
|
-
$rotate-caret: if($position == 'top', 180deg, 0);
|
|
108
|
-
|
|
109
|
-
&::before {
|
|
110
|
-
transform: translate($translate-x, $translate-y-caret) rotate($rotate-caret);
|
|
111
|
-
|
|
112
|
-
@if ($position == 'top') {
|
|
113
|
-
top: 1px;
|
|
114
|
-
} @else {
|
|
115
|
-
bottom: 0;
|
|
116
|
-
}
|
|
117
|
-
@if ($align == 'start') {
|
|
118
|
-
margin-left: 4px;
|
|
119
|
-
} @else if ($align == 'end') {
|
|
120
|
-
right: 0;
|
|
121
|
-
left: auto;
|
|
122
|
-
margin-right: 4px;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
&::after {
|
|
127
|
-
transform: translate($translate-x, $translate-y-body);
|
|
128
|
-
|
|
129
|
-
@if ($position == 'top') {
|
|
130
|
-
top: 0;
|
|
131
|
-
} @else {
|
|
132
|
-
bottom: 0;
|
|
133
|
-
}
|
|
134
|
-
@if ($align != 'center') {
|
|
135
|
-
margin-left: 0;
|
|
136
|
-
}
|
|
137
|
-
@if ($align == 'end') {
|
|
138
|
-
right: 0;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// legacy definition tooltip mixin
|
|
144
|
-
/// @access private
|
|
145
|
-
/// @deprecated
|
|
146
|
-
/// @group tooltip
|
|
147
|
-
// V11: possibly remove in V11
|
|
148
|
-
@mixin tooltip--definition--legacy {
|
|
149
|
-
.#{$prefix}--tooltip--definition {
|
|
150
|
-
@include reset;
|
|
151
|
-
|
|
152
|
-
position: relative;
|
|
153
|
-
|
|
154
|
-
.#{$prefix}--tooltip__trigger {
|
|
155
|
-
@include type.type-style('label-01');
|
|
156
|
-
|
|
157
|
-
position: relative;
|
|
158
|
-
display: inline-flex;
|
|
159
|
-
border-bottom: 1px dotted $highlight;
|
|
160
|
-
color: $text-primary;
|
|
161
|
-
|
|
162
|
-
&:hover {
|
|
163
|
-
+ .#{$prefix}--tooltip--definition__top,
|
|
164
|
-
+ .#{$prefix}--tooltip--definition__bottom {
|
|
165
|
-
display: block;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
&:focus {
|
|
170
|
-
@include focus-outline('border');
|
|
171
|
-
|
|
172
|
-
+ .#{$prefix}--tooltip--definition__top,
|
|
173
|
-
+ .#{$prefix}--tooltip--definition__bottom {
|
|
174
|
-
display: block;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
.#{$prefix}--tooltip--definition__bottom,
|
|
181
|
-
.#{$prefix}--tooltip--definition__top {
|
|
182
|
-
@include box-shadow;
|
|
183
|
-
|
|
184
|
-
position: absolute;
|
|
185
|
-
z-index: 1;
|
|
186
|
-
display: none;
|
|
187
|
-
width: rem(208px);
|
|
188
|
-
padding: $spacing-03 $spacing-05;
|
|
189
|
-
margin-top: $spacing-04;
|
|
190
|
-
background: $background-inverse;
|
|
191
|
-
border-radius: rem(2px);
|
|
192
|
-
pointer-events: none;
|
|
193
|
-
|
|
194
|
-
p {
|
|
195
|
-
@include type.type-style('body-short-01');
|
|
196
|
-
|
|
197
|
-
color: $text-inverse;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
.#{$prefix}--tooltip__caret {
|
|
201
|
-
position: absolute;
|
|
202
|
-
right: 0;
|
|
203
|
-
left: 0;
|
|
204
|
-
width: 0.6rem;
|
|
205
|
-
height: 0.6rem;
|
|
206
|
-
margin-left: $spacing-05;
|
|
207
|
-
background: $background-inverse;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
// Tooltip Definition caret - bottom position
|
|
212
|
-
.#{$prefix}--tooltip--definition__bottom .#{$prefix}--tooltip__caret {
|
|
213
|
-
top: -0.2rem;
|
|
214
|
-
transform: rotate(-135deg);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
// Tooltip Definition caret - top position
|
|
218
|
-
.#{$prefix}--tooltip--definition__top {
|
|
219
|
-
margin-top: rem(-32px);
|
|
220
|
-
transform: translateY(-100%);
|
|
221
|
-
|
|
222
|
-
.#{$prefix}--tooltip__caret {
|
|
223
|
-
bottom: -0.2rem;
|
|
224
|
-
transform: rotate(45deg);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
.#{$prefix}--tooltip--definition__align-end {
|
|
229
|
-
right: 0;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
.#{$prefix}--tooltip--definition__align-center {
|
|
233
|
-
margin-left: 50%;
|
|
234
|
-
transform: translateX(-50%);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
.#{$prefix}--tooltip--definition__top.#{$prefix}--tooltip--definition__align-center {
|
|
238
|
-
margin-left: 50%;
|
|
239
|
-
transform: translate(-50%, -100%);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
.#{$prefix}--tooltip--definition__align-center .#{$prefix}--tooltip__caret {
|
|
243
|
-
left: auto;
|
|
244
|
-
// Adjust by the half of the diagonal of the caret, which sizes 0.6rem
|
|
245
|
-
margin-right: calc(50% - 6px);
|
|
246
|
-
margin-left: auto;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
.#{$prefix}--tooltip--definition__align-end .#{$prefix}--tooltip__caret {
|
|
250
|
-
left: auto;
|
|
251
|
-
margin-right: rem(16px);
|
|
252
|
-
margin-left: auto;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
// legacy icon tooltip mixin
|
|
257
|
-
/// @access private
|
|
258
|
-
/// @deprecated
|
|
259
|
-
/// @group tooltip
|
|
260
|
-
// V11: possibly remove in V11
|
|
261
|
-
@mixin tooltip--icon--legacy {
|
|
262
|
-
// Icon CSS only tooltip
|
|
263
|
-
.#{$prefix}--tooltip--icon {
|
|
264
|
-
display: inline-flex;
|
|
265
|
-
align-items: center;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
.#{$prefix}--tooltip--icon__top,
|
|
269
|
-
.#{$prefix}--tooltip--icon__bottom {
|
|
270
|
-
@include tooltip--icon;
|
|
271
|
-
|
|
272
|
-
&:hover,
|
|
273
|
-
&:focus {
|
|
274
|
-
svg {
|
|
275
|
-
fill: $icon-secondary;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
&:focus {
|
|
280
|
-
outline: 1px solid transparent;
|
|
281
|
-
|
|
282
|
-
svg {
|
|
283
|
-
@include focus-outline('border');
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
// Tooltip Icon caret - top position
|
|
289
|
-
.#{$prefix}--tooltip--icon__top {
|
|
290
|
-
@include tooltip--icon-placement('top');
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
// Tooltip Icon caret - bottom position
|
|
294
|
-
.#{$prefix}--tooltip--icon__bottom {
|
|
295
|
-
@include tooltip--icon-placement('bottom');
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
// Tooltip Icon caret - top position, left alignment
|
|
299
|
-
.#{$prefix}--tooltip--icon__top.#{$prefix}--tooltip--icon__align-start {
|
|
300
|
-
@include tooltip--icon-placement('top', 'start');
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
// Tooltip Icon caret - top position, right alignment
|
|
304
|
-
.#{$prefix}--tooltip--icon__top.#{$prefix}--tooltip--icon__align-end {
|
|
305
|
-
@include tooltip--icon-placement('top', 'end');
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
// Tooltip Icon caret - bottom position, left alignment
|
|
309
|
-
.#{$prefix}--tooltip--icon__bottom.#{$prefix}--tooltip--icon__align-start {
|
|
310
|
-
@include tooltip--icon-placement('bottom', 'start');
|
|
311
|
-
}
|
|
9
|
+
@use '../../spacing';
|
|
10
|
+
@use '../../theme';
|
|
11
|
+
@use '../../type';
|
|
12
|
+
@use '../../utilities/custom-property';
|
|
13
|
+
@use '../../utilities/convert';
|
|
312
14
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
15
|
+
$tooltip-padding-block: custom-property.get-var(
|
|
16
|
+
'tooltip-padding-block',
|
|
17
|
+
spacing.$spacing-05
|
|
18
|
+
);
|
|
317
19
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
}
|
|
20
|
+
$tooltip-padding-inline: custom-property.get-var(
|
|
21
|
+
'tooltip-padding-inline',
|
|
22
|
+
spacing.$spacing-05
|
|
23
|
+
);
|
|
323
24
|
|
|
324
|
-
/// Tooltip styles
|
|
325
|
-
/// @access private
|
|
326
|
-
/// @group tooltip
|
|
327
25
|
@mixin tooltip {
|
|
328
|
-
// Caret's original size was 13.75px square
|
|
329
|
-
$caret-size: rem(6.875px);
|
|
330
|
-
|
|
331
|
-
.#{$prefix}--tooltip__label {
|
|
332
|
-
@include type.type-style('label-01');
|
|
333
|
-
|
|
334
|
-
display: inline-flex;
|
|
335
|
-
align-items: center;
|
|
336
|
-
color: $text-secondary;
|
|
337
|
-
|
|
338
|
-
&:focus {
|
|
339
|
-
@include focus-outline('border');
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
.#{$prefix}--tooltip__trigger svg {
|
|
344
|
-
fill: $icon-secondary;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
.#{$prefix}--tooltip__trigger:not(.#{$prefix}--btn--icon-only) {
|
|
348
|
-
@include button-reset.reset($width: false);
|
|
349
|
-
|
|
350
|
-
display: inline-flex;
|
|
351
|
-
align-items: center;
|
|
352
|
-
font-size: 1rem;
|
|
353
|
-
|
|
354
|
-
&:focus {
|
|
355
|
-
@include focus-outline('border');
|
|
356
|
-
|
|
357
|
-
fill: button.$button-primary-hover;
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
// Disabled styles
|
|
362
|
-
.#{$prefix}--tooltip__trigger:not(.#{$prefix}--btn--icon-only)[disabled] svg {
|
|
363
|
-
fill: $icon-disabled;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
.#{$prefix}--tooltip__label .#{$prefix}--tooltip__trigger {
|
|
367
|
-
// Override `margin: 0` from button-reset mixin
|
|
368
|
-
margin-left: $spacing-03;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
.#{$prefix}--tooltip__label--bold {
|
|
372
|
-
font-weight: 600;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
26
|
.#{$prefix}--tooltip {
|
|
376
|
-
@include
|
|
377
|
-
@include reset;
|
|
378
|
-
|
|
379
|
-
position: absolute;
|
|
380
|
-
z-index: z('floating');
|
|
381
|
-
display: none;
|
|
382
|
-
min-width: rem(208px);
|
|
383
|
-
max-width: rem(288px);
|
|
384
|
-
padding: $spacing-05;
|
|
385
|
-
margin-top: $spacing-02;
|
|
386
|
-
background: $background-inverse;
|
|
387
|
-
border-radius: rem(2px);
|
|
388
|
-
color: $text-inverse;
|
|
389
|
-
word-wrap: break-word;
|
|
390
|
-
|
|
391
|
-
// @todo this can be deprecated in v11 since focus should always be on the content container not the tooltip
|
|
392
|
-
// V11: remove in V11
|
|
393
|
-
&:focus {
|
|
394
|
-
box-shadow: inset 0 0 0 1px $background-inverse,
|
|
395
|
-
inset 0 0 0 2px $background;
|
|
396
|
-
outline: 0;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
&.#{$prefix}--tooltip--top.#{$prefix}--tooltip--align-start,
|
|
400
|
-
&.#{$prefix}--tooltip--bottom.#{$prefix}--tooltip--align-start {
|
|
401
|
-
transform: translate(calc(50% - 22px), 0);
|
|
402
|
-
|
|
403
|
-
.#{$prefix}--tooltip__caret {
|
|
404
|
-
margin-left: 15px;
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
&.#{$prefix}--tooltip--top.#{$prefix}--tooltip--align-end,
|
|
409
|
-
&.#{$prefix}--tooltip--bottom.#{$prefix}--tooltip--align-end {
|
|
410
|
-
transform: translate(calc(22px - 50%), 0);
|
|
411
|
-
|
|
412
|
-
.#{$prefix}--tooltip__caret {
|
|
413
|
-
margin-right: 15px;
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
&.#{$prefix}--tooltip--left.#{$prefix}--tooltip--align-start {
|
|
418
|
-
transform: translate(0, calc(-15px + 50%));
|
|
419
|
-
|
|
420
|
-
.#{$prefix}--tooltip__caret {
|
|
421
|
-
top: 14px;
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
&.#{$prefix}--tooltip--left.#{$prefix}--tooltip--align-end {
|
|
426
|
-
transform: translate(0, calc(31px - 50%));
|
|
427
|
-
|
|
428
|
-
.#{$prefix}--tooltip__caret {
|
|
429
|
-
top: initial;
|
|
430
|
-
bottom: 25px;
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
&.#{$prefix}--tooltip--right.#{$prefix}--tooltip--align-start {
|
|
435
|
-
transform: translate(0, calc(-26px + 50%));
|
|
436
|
-
|
|
437
|
-
.#{$prefix}--tooltip__caret {
|
|
438
|
-
top: 26px;
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
&.#{$prefix}--tooltip--right.#{$prefix}--tooltip--align-end {
|
|
443
|
-
transform: translate(0, calc(20px - 50%));
|
|
444
|
-
|
|
445
|
-
.#{$prefix}--tooltip__caret {
|
|
446
|
-
top: initial;
|
|
447
|
-
bottom: 12px;
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
p {
|
|
452
|
-
@include type.type-style('body-short-01');
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
button {
|
|
456
|
-
padding-right: $spacing-07;
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
.#{$prefix}--btn:focus {
|
|
460
|
-
border-color: $focus-inverse;
|
|
461
|
-
outline-color: $background-inverse;
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
.#{$prefix}--link {
|
|
465
|
-
color: $link-inverse;
|
|
466
|
-
font-size: rem(14px);
|
|
467
|
-
|
|
468
|
-
&:focus {
|
|
469
|
-
outline: 1px solid $focus-inverse;
|
|
470
|
-
outline-offset: 2px;
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
&:active,
|
|
474
|
-
&:active:visited,
|
|
475
|
-
&:active:visited:hover {
|
|
476
|
-
color: $text-inverse;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
&:visited {
|
|
480
|
-
color: $link-inverse;
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
// Tooltips need to be click focusable but not sequentially focusable so the user can click within
|
|
485
|
-
// the tooltip and not have it close. Because the element is not actionable it does not need
|
|
486
|
-
// to have a visible focus indicator (OK'd by IBMa)
|
|
487
|
-
.#{$prefix}--tooltip__content[tabindex='-1']:focus {
|
|
488
|
-
outline: none;
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
.#{$prefix}--tooltip__caret {
|
|
492
|
-
position: absolute;
|
|
493
|
-
top: calc(#{$caret-size * (-1)} + 1px);
|
|
494
|
-
right: 0;
|
|
495
|
-
left: 0;
|
|
496
|
-
width: 0;
|
|
497
|
-
height: 0;
|
|
498
|
-
border-right: $caret-size solid transparent;
|
|
499
|
-
border-bottom: $caret-size solid $background-inverse;
|
|
500
|
-
border-left: $caret-size solid transparent;
|
|
501
|
-
margin: 0 auto;
|
|
502
|
-
content: '';
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
.#{$prefix}--tooltip__footer {
|
|
506
|
-
display: flex;
|
|
507
|
-
align-items: center;
|
|
508
|
-
justify-content: space-between;
|
|
509
|
-
margin-top: 1rem;
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
&[data-floating-menu-direction='left'] {
|
|
513
|
-
margin-left: calc(#{$spacing-03} * -1);
|
|
514
|
-
|
|
515
|
-
.#{$prefix}--tooltip__caret {
|
|
516
|
-
top: 50%;
|
|
517
|
-
// left position has an additional space between caret and tooltip
|
|
518
|
-
right: calc(#{$caret-size * (-1)} + 1px);
|
|
519
|
-
left: auto;
|
|
520
|
-
transform: rotate(90deg) translate(50%, -50%);
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
&[data-floating-menu-direction='top'] {
|
|
525
|
-
margin-top: calc(#{$spacing-03} * -1);
|
|
526
|
-
|
|
527
|
-
.#{$prefix}--tooltip__caret {
|
|
528
|
-
top: auto;
|
|
529
|
-
bottom: calc(#{$caret-size * (-1)} + 1px);
|
|
530
|
-
transform: rotate(180deg);
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
&[data-floating-menu-direction='right'] {
|
|
535
|
-
margin-left: $spacing-03;
|
|
536
|
-
|
|
537
|
-
.#{$prefix}--tooltip__caret {
|
|
538
|
-
top: 50%;
|
|
539
|
-
right: auto;
|
|
540
|
-
left: calc(#{$caret-size * (-1)} + 1px);
|
|
541
|
-
transform: rotate(270deg) translate(50%, -50%);
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
&[data-floating-menu-direction='bottom'] {
|
|
546
|
-
margin-top: $spacing-03;
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
.#{$prefix}--tooltip__heading {
|
|
551
|
-
@include type.type-style('productive-heading-01');
|
|
552
|
-
|
|
553
|
-
margin-bottom: $spacing-03;
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
.#{$prefix}--tooltip--shown {
|
|
557
|
-
display: block;
|
|
558
|
-
margin-top: 0;
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
// Tooltip Definition
|
|
562
|
-
/* begin legacy definition tooltip TODO: deprecate */
|
|
563
|
-
@include tooltip--definition--legacy;
|
|
564
|
-
/* end legacy definition tooltip */
|
|
565
|
-
|
|
566
|
-
.#{$prefix}--tooltip--definition.#{$prefix}--tooltip--a11y {
|
|
567
|
-
// Wrapping element set to inline since the tooltip isn't contained within the trigger (affects center and end alignments)
|
|
568
|
-
// Also allows for Definition Tooltip to be used within a paragraph of text as defined in the usage guidelines
|
|
569
|
-
display: inline-flex;
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
// default buttons in Safari are adding a small margin, affecting tooltip placement
|
|
573
|
-
.#{$prefix}--tooltip--definition button.#{$prefix}--tooltip--a11y {
|
|
574
|
-
margin: 0;
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
// Definition CSS only tooltip
|
|
578
|
-
.#{$prefix}--tooltip__trigger.#{$prefix}--tooltip__trigger--definition {
|
|
579
|
-
@include type.type-style('label-01');
|
|
580
|
-
|
|
581
|
-
border-bottom: rem(1px) dotted $icon-secondary;
|
|
582
|
-
transition: border-color $duration-fast-02;
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
.#{$prefix}--tooltip__trigger.#{$prefix}--tooltip__trigger--definition:hover,
|
|
586
|
-
.#{$prefix}--tooltip__trigger.#{$prefix}--tooltip__trigger--definition:focus {
|
|
587
|
-
border-bottom-color: $interactive;
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
.#{$prefix}--tooltip__trigger.#{$prefix}--tooltip__trigger--definition.#{$prefix}--tooltip--top {
|
|
591
|
-
@include tooltip--trigger('definition', 'top');
|
|
592
|
-
@include tooltip--placement('definition', 'top', 'start');
|
|
593
|
-
|
|
594
|
-
&.#{$prefix}--tooltip--align-start {
|
|
595
|
-
@include tooltip--placement('definition', 'top', 'start');
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
&.#{$prefix}--tooltip--align-center {
|
|
599
|
-
@include tooltip--placement('definition', 'top', 'center');
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
&.#{$prefix}--tooltip--align-end {
|
|
603
|
-
@include tooltip--placement('definition', 'top', 'end');
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
.#{$prefix}--tooltip__trigger.#{$prefix}--tooltip__trigger--definition.#{$prefix}--tooltip--bottom {
|
|
608
|
-
@include tooltip--trigger('definition', 'bottom');
|
|
609
|
-
@include tooltip--placement('definition', 'bottom', 'start');
|
|
610
|
-
|
|
611
|
-
&.#{$prefix}--tooltip--align-start {
|
|
612
|
-
@include tooltip--placement('definition', 'bottom', 'start');
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
&.#{$prefix}--tooltip--align-center {
|
|
616
|
-
@include tooltip--placement('definition', 'bottom', 'center');
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
&.#{$prefix}--tooltip--align-end {
|
|
620
|
-
@include tooltip--placement('definition', 'bottom', 'end');
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
// Tooltip Icon
|
|
625
|
-
|
|
626
|
-
/* begin tooltip icon (TODO: deprecate) */
|
|
627
|
-
@include tooltip--icon--legacy;
|
|
628
|
-
/* end legacy tooltip icon */
|
|
629
|
-
|
|
630
|
-
// Icon CSS only tooltip
|
|
631
|
-
.#{$prefix}--tooltip__trigger {
|
|
632
|
-
&:hover,
|
|
633
|
-
&:focus {
|
|
634
|
-
svg {
|
|
635
|
-
fill: $icon-secondary;
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
.#{$prefix}--tooltip__trigger.#{$prefix}--tooltip--top {
|
|
641
|
-
@include tooltip--trigger('icon', 'top');
|
|
642
|
-
@include tooltip--placement('icon', 'top', 'center');
|
|
643
|
-
|
|
644
|
-
&.#{$prefix}--tooltip--align-start {
|
|
645
|
-
@include tooltip--placement('icon', 'top', 'start');
|
|
646
|
-
}
|
|
647
|
-
|
|
648
|
-
&.#{$prefix}--tooltip--align-center {
|
|
649
|
-
@include tooltip--placement('icon', 'top', 'center');
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
&.#{$prefix}--tooltip--align-end {
|
|
653
|
-
@include tooltip--placement('icon', 'top', 'end');
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
.#{$prefix}--tooltip__trigger.#{$prefix}--tooltip--right {
|
|
658
|
-
@include tooltip--trigger('icon', 'right');
|
|
659
|
-
@include tooltip--placement('icon', 'right', 'center');
|
|
660
|
-
|
|
661
|
-
&.#{$prefix}--tooltip--align-start {
|
|
662
|
-
@include tooltip--placement('icon', 'right', 'start');
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
&.#{$prefix}--tooltip--align-center {
|
|
666
|
-
@include tooltip--placement('icon', 'right', 'center');
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
&.#{$prefix}--tooltip--align-end {
|
|
670
|
-
@include tooltip--placement('icon', 'right', 'end');
|
|
671
|
-
}
|
|
27
|
+
@include custom-property.declaration('popover-offset', 12px);
|
|
672
28
|
}
|
|
673
29
|
|
|
674
|
-
.#{$prefix}--
|
|
675
|
-
@include
|
|
676
|
-
@include tooltip--placement('icon', 'bottom', 'center');
|
|
677
|
-
|
|
678
|
-
&.#{$prefix}--tooltip--align-start {
|
|
679
|
-
@include tooltip--placement('icon', 'bottom', 'start');
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
&.#{$prefix}--tooltip--align-center {
|
|
683
|
-
@include tooltip--placement('icon', 'bottom', 'center');
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
&.#{$prefix}--tooltip--align-end {
|
|
687
|
-
@include tooltip--placement('icon', 'bottom', 'end');
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
.#{$prefix}--tooltip__trigger.#{$prefix}--tooltip--left {
|
|
692
|
-
@include tooltip--trigger('icon', 'left');
|
|
693
|
-
@include tooltip--placement('icon', 'left', 'center');
|
|
694
|
-
|
|
695
|
-
&.#{$prefix}--tooltip--align-start {
|
|
696
|
-
@include tooltip--placement('icon', 'left', 'start');
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
&.#{$prefix}--tooltip--align-center {
|
|
700
|
-
@include tooltip--placement('icon', 'left', 'center');
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
&.#{$prefix}--tooltip--align-end {
|
|
704
|
-
@include tooltip--placement('icon', 'left', 'end');
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
// Allow pointer events on tooltip when tooltip is visible
|
|
709
|
-
.#{$prefix}--tooltip__trigger:not(.#{$prefix}--tooltip--hidden)
|
|
710
|
-
.#{$prefix}--assistive-text {
|
|
711
|
-
pointer-events: all;
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
// Windows HCM fix
|
|
715
|
-
/* stylelint-disable */
|
|
716
|
-
.#{$prefix}--tooltip__trigger svg,
|
|
717
|
-
.#{$prefix}--tooltip__trigger:hover svg,
|
|
718
|
-
.#{$prefix}--tooltip__trigger:focus svg {
|
|
719
|
-
@include high-contrast-mode('icon-fill');
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
.#{$prefix}--tooltip__trigger:focus svg {
|
|
723
|
-
@include high-contrast-mode('focus');
|
|
724
|
-
}
|
|
30
|
+
.#{$prefix}--tooltip-content {
|
|
31
|
+
@include type.type-style('body-long-01');
|
|
725
32
|
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
}
|
|
33
|
+
max-width: convert.rem(288px);
|
|
34
|
+
padding: $tooltip-padding-block $tooltip-padding-inline;
|
|
729
35
|
|
|
730
|
-
|
|
731
|
-
@include high-contrast-mode('outline');
|
|
36
|
+
color: theme.$text-inverse;
|
|
732
37
|
}
|
|
733
38
|
}
|
|
734
39
|
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
40
|
+
@mixin icon-tooltip {
|
|
41
|
+
.#{$prefix}--icon-tooltip {
|
|
42
|
+
@include custom-property.declaration(
|
|
43
|
+
'tooltip-padding-block',
|
|
44
|
+
convert.rem(2px)
|
|
45
|
+
);
|
|
46
|
+
@include custom-property.declaration(
|
|
47
|
+
'popover-caret-width',
|
|
48
|
+
convert.rem(8px)
|
|
49
|
+
);
|
|
50
|
+
@include custom-property.declaration(
|
|
51
|
+
'popover-caret-height',
|
|
52
|
+
convert.rem(4px)
|
|
53
|
+
);
|
|
54
|
+
@include custom-property.declaration('popover-offset', convert.rem(8px));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.#{$prefix}--icon-tooltip .#{$prefix}--tooltip-content {
|
|
58
|
+
@include type.type-style('body-short-01');
|
|
746
59
|
}
|
|
747
60
|
}
|