Skip to content

Commit

Permalink
Fix tooltip body placement with variation placements
Browse files Browse the repository at this point in the history
  • Loading branch information
kyletsang authored and mdo committed Mar 25, 2023
1 parent 208ba3d commit d533e6f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion js/src/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const Default = {
delay: 0,
fallbackPlacements: ['top', 'right', 'bottom', 'left'],
html: false,
offset: [0, 0],
offset: [0, 6],
placement: 'top',
popperConfig: null,
sanitize: true,
Expand Down
9 changes: 4 additions & 5 deletions scss/_tooltip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

z-index: var(--#{$prefix}tooltip-zindex);
display: block;
padding: var(--#{$prefix}tooltip-arrow-height);
margin: var(--#{$prefix}tooltip-margin);
@include deprecate("`$tooltip-margin`", "v5", "v5.x", true);
// Our parent element can be arbitrary since tooltips are by default inserted as a sibling of their target element.
Expand Down Expand Up @@ -45,7 +44,7 @@
}

.bs-tooltip-top .tooltip-arrow {
bottom: 0;
bottom: calc(-1 * var(--#{$prefix}tooltip-arrow-height)); // stylelint-disable-line function-disallowed-list

&::before {
top: -1px;
Expand All @@ -56,7 +55,7 @@

/* rtl:begin:ignore */
.bs-tooltip-end .tooltip-arrow {
left: 0;
left: calc(-1 * var(--#{$prefix}tooltip-arrow-height)); // stylelint-disable-line function-disallowed-list
width: var(--#{$prefix}tooltip-arrow-height);
height: var(--#{$prefix}tooltip-arrow-width);

Expand All @@ -70,7 +69,7 @@
/* rtl:end:ignore */

.bs-tooltip-bottom .tooltip-arrow {
top: 0;
top: calc(-1 * var(--#{$prefix}tooltip-arrow-height)); // stylelint-disable-line function-disallowed-list

&::before {
bottom: -1px;
Expand All @@ -81,7 +80,7 @@

/* rtl:begin:ignore */
.bs-tooltip-start .tooltip-arrow {
right: 0;
right: calc(-1 * var(--#{$prefix}tooltip-arrow-height)); // stylelint-disable-line function-disallowed-list
width: var(--#{$prefix}tooltip-arrow-height);
height: var(--#{$prefix}tooltip-arrow-width);

Expand Down

0 comments on commit d533e6f

Please sign in to comment.