1 |
efrain |
1 |
// Base class
|
|
|
2 |
.tooltip {
|
1441 |
ariadna |
3 |
// scss-docs-start tooltip-css-vars
|
|
|
4 |
--#{$prefix}tooltip-zindex: #{$zindex-tooltip};
|
|
|
5 |
--#{$prefix}tooltip-max-width: #{$tooltip-max-width};
|
|
|
6 |
--#{$prefix}tooltip-padding-x: #{$tooltip-padding-x};
|
|
|
7 |
--#{$prefix}tooltip-padding-y: #{$tooltip-padding-y};
|
|
|
8 |
--#{$prefix}tooltip-margin: #{$tooltip-margin};
|
|
|
9 |
@include rfs($tooltip-font-size, --#{$prefix}tooltip-font-size);
|
|
|
10 |
--#{$prefix}tooltip-color: #{$tooltip-color};
|
|
|
11 |
--#{$prefix}tooltip-bg: #{$tooltip-bg};
|
|
|
12 |
--#{$prefix}tooltip-border-radius: #{$tooltip-border-radius};
|
|
|
13 |
--#{$prefix}tooltip-opacity: #{$tooltip-opacity};
|
|
|
14 |
--#{$prefix}tooltip-arrow-width: #{$tooltip-arrow-width};
|
|
|
15 |
--#{$prefix}tooltip-arrow-height: #{$tooltip-arrow-height};
|
|
|
16 |
// scss-docs-end tooltip-css-vars
|
|
|
17 |
|
|
|
18 |
z-index: var(--#{$prefix}tooltip-zindex);
|
1 |
efrain |
19 |
display: block;
|
1441 |
ariadna |
20 |
margin: var(--#{$prefix}tooltip-margin);
|
|
|
21 |
@include deprecate("`$tooltip-margin`", "v5", "v5.x", true);
|
1 |
efrain |
22 |
// Our parent element can be arbitrary since tooltips are by default inserted as a sibling of their target element.
|
|
|
23 |
// So reset our font and text properties to avoid inheriting weird values.
|
|
|
24 |
@include reset-text();
|
1441 |
ariadna |
25 |
@include font-size(var(--#{$prefix}tooltip-font-size));
|
1 |
efrain |
26 |
// Allow breaking very long words so they don't overflow the tooltip's bounds
|
|
|
27 |
word-wrap: break-word;
|
|
|
28 |
opacity: 0;
|
|
|
29 |
|
1441 |
ariadna |
30 |
&.show { opacity: var(--#{$prefix}tooltip-opacity); }
|
1 |
efrain |
31 |
|
1441 |
ariadna |
32 |
.tooltip-arrow {
|
1 |
efrain |
33 |
display: block;
|
1441 |
ariadna |
34 |
width: var(--#{$prefix}tooltip-arrow-width);
|
|
|
35 |
height: var(--#{$prefix}tooltip-arrow-height);
|
1 |
efrain |
36 |
|
|
|
37 |
&::before {
|
|
|
38 |
position: absolute;
|
|
|
39 |
content: "";
|
|
|
40 |
border-color: transparent;
|
|
|
41 |
border-style: solid;
|
|
|
42 |
}
|
|
|
43 |
}
|
|
|
44 |
}
|
|
|
45 |
|
1441 |
ariadna |
46 |
.bs-tooltip-top .tooltip-arrow {
|
|
|
47 |
bottom: calc(-1 * var(--#{$prefix}tooltip-arrow-height)); // stylelint-disable-line function-disallowed-list
|
1 |
efrain |
48 |
|
1441 |
ariadna |
49 |
&::before {
|
|
|
50 |
top: -1px;
|
|
|
51 |
border-width: var(--#{$prefix}tooltip-arrow-height) calc(var(--#{$prefix}tooltip-arrow-width) * .5) 0; // stylelint-disable-line function-disallowed-list
|
|
|
52 |
border-top-color: var(--#{$prefix}tooltip-bg);
|
1 |
efrain |
53 |
}
|
|
|
54 |
}
|
|
|
55 |
|
1441 |
ariadna |
56 |
/* rtl:begin:ignore */
|
|
|
57 |
.bs-tooltip-end .tooltip-arrow {
|
|
|
58 |
left: calc(-1 * var(--#{$prefix}tooltip-arrow-height)); // stylelint-disable-line function-disallowed-list
|
|
|
59 |
width: var(--#{$prefix}tooltip-arrow-height);
|
|
|
60 |
height: var(--#{$prefix}tooltip-arrow-width);
|
1 |
efrain |
61 |
|
1441 |
ariadna |
62 |
&::before {
|
|
|
63 |
right: -1px;
|
|
|
64 |
border-width: calc(var(--#{$prefix}tooltip-arrow-width) * .5) var(--#{$prefix}tooltip-arrow-height) calc(var(--#{$prefix}tooltip-arrow-width) * .5) 0; // stylelint-disable-line function-disallowed-list
|
|
|
65 |
border-right-color: var(--#{$prefix}tooltip-bg);
|
1 |
efrain |
66 |
}
|
|
|
67 |
}
|
|
|
68 |
|
1441 |
ariadna |
69 |
/* rtl:end:ignore */
|
1 |
efrain |
70 |
|
1441 |
ariadna |
71 |
.bs-tooltip-bottom .tooltip-arrow {
|
|
|
72 |
top: calc(-1 * var(--#{$prefix}tooltip-arrow-height)); // stylelint-disable-line function-disallowed-list
|
1 |
efrain |
73 |
|
1441 |
ariadna |
74 |
&::before {
|
|
|
75 |
bottom: -1px;
|
|
|
76 |
border-width: 0 calc(var(--#{$prefix}tooltip-arrow-width) * .5) var(--#{$prefix}tooltip-arrow-height); // stylelint-disable-line function-disallowed-list
|
|
|
77 |
border-bottom-color: var(--#{$prefix}tooltip-bg);
|
1 |
efrain |
78 |
}
|
|
|
79 |
}
|
|
|
80 |
|
1441 |
ariadna |
81 |
/* rtl:begin:ignore */
|
|
|
82 |
.bs-tooltip-start .tooltip-arrow {
|
|
|
83 |
right: calc(-1 * var(--#{$prefix}tooltip-arrow-height)); // stylelint-disable-line function-disallowed-list
|
|
|
84 |
width: var(--#{$prefix}tooltip-arrow-height);
|
|
|
85 |
height: var(--#{$prefix}tooltip-arrow-width);
|
1 |
efrain |
86 |
|
1441 |
ariadna |
87 |
&::before {
|
|
|
88 |
left: -1px;
|
|
|
89 |
border-width: calc(var(--#{$prefix}tooltip-arrow-width) * .5) 0 calc(var(--#{$prefix}tooltip-arrow-width) * .5) var(--#{$prefix}tooltip-arrow-height); // stylelint-disable-line function-disallowed-list
|
|
|
90 |
border-left-color: var(--#{$prefix}tooltip-bg);
|
1 |
efrain |
91 |
}
|
|
|
92 |
}
|
|
|
93 |
|
1441 |
ariadna |
94 |
/* rtl:end:ignore */
|
|
|
95 |
|
1 |
efrain |
96 |
.bs-tooltip-auto {
|
1441 |
ariadna |
97 |
&[data-popper-placement^="top"] {
|
1 |
efrain |
98 |
@extend .bs-tooltip-top;
|
|
|
99 |
}
|
1441 |
ariadna |
100 |
&[data-popper-placement^="right"] {
|
|
|
101 |
@extend .bs-tooltip-end;
|
1 |
efrain |
102 |
}
|
1441 |
ariadna |
103 |
&[data-popper-placement^="bottom"] {
|
1 |
efrain |
104 |
@extend .bs-tooltip-bottom;
|
|
|
105 |
}
|
1441 |
ariadna |
106 |
&[data-popper-placement^="left"] {
|
|
|
107 |
@extend .bs-tooltip-start;
|
1 |
efrain |
108 |
}
|
|
|
109 |
}
|
|
|
110 |
|
|
|
111 |
// Wrapper for the tooltip content
|
|
|
112 |
.tooltip-inner {
|
1441 |
ariadna |
113 |
max-width: var(--#{$prefix}tooltip-max-width);
|
|
|
114 |
padding: var(--#{$prefix}tooltip-padding-y) var(--#{$prefix}tooltip-padding-x);
|
|
|
115 |
color: var(--#{$prefix}tooltip-color);
|
1 |
efrain |
116 |
text-align: center;
|
1441 |
ariadna |
117 |
background-color: var(--#{$prefix}tooltip-bg);
|
|
|
118 |
@include border-radius(var(--#{$prefix}tooltip-border-radius));
|
1 |
efrain |
119 |
}
|