2020-05-19 16:53:54 +00:00
|
|
|
// Base class
|
|
|
|
.tooltip {
|
2022-11-04 15:49:41 +00:00
|
|
|
// scss-docs-start tooltip-css-vars
|
|
|
|
--#{$prefix}tooltip-zindex: #{$zindex-tooltip};
|
|
|
|
--#{$prefix}tooltip-max-width: #{$tooltip-max-width};
|
|
|
|
--#{$prefix}tooltip-padding-x: #{$tooltip-padding-x};
|
|
|
|
--#{$prefix}tooltip-padding-y: #{$tooltip-padding-y};
|
|
|
|
--#{$prefix}tooltip-margin: #{$tooltip-margin};
|
|
|
|
@include rfs($tooltip-font-size, --#{$prefix}tooltip-font-size);
|
|
|
|
--#{$prefix}tooltip-color: #{$tooltip-color};
|
|
|
|
--#{$prefix}tooltip-bg: #{$tooltip-bg};
|
|
|
|
--#{$prefix}tooltip-border-radius: #{$tooltip-border-radius};
|
|
|
|
--#{$prefix}tooltip-opacity: #{$tooltip-opacity};
|
|
|
|
--#{$prefix}tooltip-arrow-width: #{$tooltip-arrow-width};
|
|
|
|
--#{$prefix}tooltip-arrow-height: #{$tooltip-arrow-height};
|
|
|
|
// scss-docs-end tooltip-css-vars
|
|
|
|
|
|
|
|
z-index: var(--#{$prefix}tooltip-zindex);
|
2020-05-19 16:53:54 +00:00
|
|
|
display: block;
|
2022-11-04 15:49:41 +00:00
|
|
|
padding: var(--#{$prefix}tooltip-arrow-height);
|
|
|
|
margin: var(--#{$prefix}tooltip-margin);
|
|
|
|
@include deprecate("`$tooltip-margin`", "v5", "v5.x", true);
|
2020-05-19 16:53:54 +00:00
|
|
|
// Our parent element can be arbitrary since tooltips are by default inserted as a sibling of their target element.
|
|
|
|
// So reset our font and text properties to avoid inheriting weird values.
|
|
|
|
@include reset-text();
|
2022-11-04 15:49:41 +00:00
|
|
|
@include font-size(var(--#{$prefix}tooltip-font-size));
|
2020-05-19 16:53:54 +00:00
|
|
|
// Allow breaking very long words so they don't overflow the tooltip's bounds
|
|
|
|
word-wrap: break-word;
|
|
|
|
opacity: 0;
|
|
|
|
|
2022-11-04 15:49:41 +00:00
|
|
|
&.show { opacity: var(--#{$prefix}tooltip-opacity); }
|
2020-05-19 16:53:54 +00:00
|
|
|
|
2021-07-07 11:12:38 +00:00
|
|
|
.tooltip-arrow {
|
2020-05-19 16:53:54 +00:00
|
|
|
display: block;
|
2022-11-04 15:49:41 +00:00
|
|
|
width: var(--#{$prefix}tooltip-arrow-width);
|
|
|
|
height: var(--#{$prefix}tooltip-arrow-height);
|
2020-05-19 16:53:54 +00:00
|
|
|
|
|
|
|
&::before {
|
|
|
|
position: absolute;
|
|
|
|
content: "";
|
|
|
|
border-color: transparent;
|
|
|
|
border-style: solid;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-04 15:49:41 +00:00
|
|
|
.bs-tooltip-top .tooltip-arrow {
|
|
|
|
bottom: 0;
|
2020-05-19 16:53:54 +00:00
|
|
|
|
2022-11-04 15:49:41 +00:00
|
|
|
&::before {
|
|
|
|
top: -1px;
|
|
|
|
border-width: var(--#{$prefix}tooltip-arrow-height) calc(var(--#{$prefix}tooltip-arrow-width) * .5) 0; // stylelint-disable-line function-disallowed-list
|
|
|
|
border-top-color: var(--#{$prefix}tooltip-bg);
|
2020-05-19 16:53:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-04 15:49:41 +00:00
|
|
|
/* rtl:begin:ignore */
|
|
|
|
.bs-tooltip-end .tooltip-arrow {
|
|
|
|
left: 0;
|
|
|
|
width: var(--#{$prefix}tooltip-arrow-height);
|
|
|
|
height: var(--#{$prefix}tooltip-arrow-width);
|
2020-05-19 16:53:54 +00:00
|
|
|
|
2022-11-04 15:49:41 +00:00
|
|
|
&::before {
|
|
|
|
right: -1px;
|
|
|
|
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
|
|
|
|
border-right-color: var(--#{$prefix}tooltip-bg);
|
2020-05-19 16:53:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-04 15:49:41 +00:00
|
|
|
/* rtl:end:ignore */
|
2020-05-19 16:53:54 +00:00
|
|
|
|
2022-11-04 15:49:41 +00:00
|
|
|
.bs-tooltip-bottom .tooltip-arrow {
|
|
|
|
top: 0;
|
2020-05-19 16:53:54 +00:00
|
|
|
|
2022-11-04 15:49:41 +00:00
|
|
|
&::before {
|
|
|
|
bottom: -1px;
|
|
|
|
border-width: 0 calc(var(--#{$prefix}tooltip-arrow-width) * .5) var(--#{$prefix}tooltip-arrow-height); // stylelint-disable-line function-disallowed-list
|
|
|
|
border-bottom-color: var(--#{$prefix}tooltip-bg);
|
2020-05-19 16:53:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-04 15:49:41 +00:00
|
|
|
/* rtl:begin:ignore */
|
|
|
|
.bs-tooltip-start .tooltip-arrow {
|
|
|
|
right: 0;
|
|
|
|
width: var(--#{$prefix}tooltip-arrow-height);
|
|
|
|
height: var(--#{$prefix}tooltip-arrow-width);
|
2020-05-19 16:53:54 +00:00
|
|
|
|
2022-11-04 15:49:41 +00:00
|
|
|
&::before {
|
|
|
|
left: -1px;
|
|
|
|
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
|
|
|
|
border-left-color: var(--#{$prefix}tooltip-bg);
|
2020-05-19 16:53:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-04 15:49:41 +00:00
|
|
|
/* rtl:end:ignore */
|
|
|
|
|
2020-05-19 16:53:54 +00:00
|
|
|
.bs-tooltip-auto {
|
2021-07-07 11:12:38 +00:00
|
|
|
&[data-popper-placement^="top"] {
|
2020-05-19 16:53:54 +00:00
|
|
|
@extend .bs-tooltip-top;
|
|
|
|
}
|
2021-07-07 11:12:38 +00:00
|
|
|
&[data-popper-placement^="right"] {
|
|
|
|
@extend .bs-tooltip-end;
|
2020-05-19 16:53:54 +00:00
|
|
|
}
|
2021-07-07 11:12:38 +00:00
|
|
|
&[data-popper-placement^="bottom"] {
|
2020-05-19 16:53:54 +00:00
|
|
|
@extend .bs-tooltip-bottom;
|
|
|
|
}
|
2021-07-07 11:12:38 +00:00
|
|
|
&[data-popper-placement^="left"] {
|
|
|
|
@extend .bs-tooltip-start;
|
2020-05-19 16:53:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Wrapper for the tooltip content
|
|
|
|
.tooltip-inner {
|
2022-11-04 15:49:41 +00:00
|
|
|
max-width: var(--#{$prefix}tooltip-max-width);
|
|
|
|
padding: var(--#{$prefix}tooltip-padding-y) var(--#{$prefix}tooltip-padding-x);
|
|
|
|
color: var(--#{$prefix}tooltip-color);
|
2020-05-19 16:53:54 +00:00
|
|
|
text-align: center;
|
2022-11-04 15:49:41 +00:00
|
|
|
background-color: var(--#{$prefix}tooltip-bg);
|
|
|
|
@include border-radius(var(--#{$prefix}tooltip-border-radius));
|
2020-05-19 16:53:54 +00:00
|
|
|
}
|