forked from carbon-design-system/carbon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_tooltip.scss
92 lines (75 loc) · 2.13 KB
/
_tooltip.scss
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
//
// Copyright IBM Corp. 2016, 2023
//
// This source code is licensed under the Apache-2.0 license found in the
// LICENSE file in the root directory of this source tree.
//
@use '../popover';
@use '../../config' as *;
@use '../../spacing';
@use '../../theme';
@use '../../type';
@use '../../layer' as *;
@use '../../utilities/custom-property';
@use '../../utilities/convert';
@use '../../utilities/button-reset';
@use '../../utilities/focus-outline';
$tooltip-padding-block: custom-property.get-var(
'tooltip-padding-block',
spacing.$spacing-05
);
$tooltip-padding-inline: custom-property.get-var(
'tooltip-padding-inline',
spacing.$spacing-05
);
@mixin tooltip {
.#{$prefix}--tooltip {
@include custom-property.declaration('popover-offset', 12px);
}
.#{$prefix}--tooltip-content {
@include type.type-style('body-01');
max-width: convert.to-rem(288px);
padding: $tooltip-padding-block $tooltip-padding-inline;
color: theme.$text-inverse;
}
}
@mixin definition-tooltip {
.#{$prefix}--definition-term {
@include button-reset.reset;
border-bottom: 1px dotted theme.$border-strong;
border-radius: 0;
color: theme.$text-primary;
}
.#{$prefix}--definition-term:focus {
@include focus-outline.focus-outline;
border-bottom-color: theme.$border-interactive;
}
.#{$prefix}--definition-term:hover {
border-bottom-color: theme.$border-interactive;
}
.#{$prefix}--definition-tooltip {
@include type.type-style('body-01');
max-width: convert.to-rem(176px);
padding: convert.to-rem(8px) convert.to-rem(16px);
}
}
@mixin icon-tooltip {
.#{$prefix}--icon-tooltip {
@include custom-property.declaration(
'tooltip-padding-block',
convert.to-rem(2px)
);
@include custom-property.declaration(
'popover-caret-width',
convert.to-rem(8px)
);
@include custom-property.declaration(
'popover-caret-height',
convert.to-rem(4px)
);
@include custom-property.declaration('popover-offset', convert.to-rem(8px));
}
.#{$prefix}--icon-tooltip .#{$prefix}--tooltip-content {
@include type.type-style('body-compact-01');
}
}