Skip to content

Commit 2b40381

Browse files
committed
Fix tooltip margin to be stick at their caller
1 parent cc455c1 commit 2b40381

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

scss/_tooltip.scss

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
position: absolute;
44
z-index: $zindex-tooltip;
55
display: block;
6+
margin: $tooltip-margin;
67
// Our parent element can be arbitrary since tooltips are by default inserted as a sibling of their target element.
78
// So reset our font and text properties to avoid inheriting weird values.
89
@include reset-text();
@@ -15,7 +16,6 @@
1516

1617
&.bs-tooltip-top {
1718
padding: $tooltip-arrow-width 0;
18-
margin-top: -$tooltip-margin;
1919

2020
.arrow::before {
2121
bottom: 0;
@@ -28,7 +28,6 @@
2828
}
2929
&.bs-tooltip-right {
3030
padding: 0 $tooltip-arrow-width;
31-
margin-left: $tooltip-margin;
3231

3332
.arrow::before {
3433
top: 50%;
@@ -41,7 +40,6 @@
4140
}
4241
&.bs-tooltip-bottom {
4342
padding: $tooltip-arrow-width 0;
44-
margin-top: $tooltip-margin;
4543

4644
.arrow::before {
4745
top: 0;
@@ -54,7 +52,6 @@
5452
}
5553
&.bs-tooltip-left {
5654
padding: 0 $tooltip-arrow-width;
57-
margin-left: -$tooltip-margin;
5855

5956
.arrow::before {
6057
top: 50%;

scss/_variables.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ $tooltip-bg: $black !default;
696696
$tooltip-opacity: .9 !default;
697697
$tooltip-padding-y: 3px !default;
698698
$tooltip-padding-x: 8px !default;
699-
$tooltip-margin: 3px !default;
699+
$tooltip-margin: 0 !default;
700700

701701
$tooltip-arrow-width: 5px !default;
702702
$tooltip-arrow-color: $tooltip-bg !default;

0 commit comments

Comments
 (0)