0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-17 09:52:29 +01:00

Fix tooltip margin to be stick at their caller

This commit is contained in:
Johann-S 2017-05-12 16:08:51 +02:00
parent cc455c16c3
commit 2b403819b7
2 changed files with 2 additions and 5 deletions

View File

@ -3,6 +3,7 @@
position: absolute; position: absolute;
z-index: $zindex-tooltip; z-index: $zindex-tooltip;
display: block; display: block;
margin: $tooltip-margin;
// Our parent element can be arbitrary since tooltips are by default inserted as a sibling of their target element. // 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. // So reset our font and text properties to avoid inheriting weird values.
@include reset-text(); @include reset-text();
@ -15,7 +16,6 @@
&.bs-tooltip-top { &.bs-tooltip-top {
padding: $tooltip-arrow-width 0; padding: $tooltip-arrow-width 0;
margin-top: -$tooltip-margin;
.arrow::before { .arrow::before {
bottom: 0; bottom: 0;
@ -28,7 +28,6 @@
} }
&.bs-tooltip-right { &.bs-tooltip-right {
padding: 0 $tooltip-arrow-width; padding: 0 $tooltip-arrow-width;
margin-left: $tooltip-margin;
.arrow::before { .arrow::before {
top: 50%; top: 50%;
@ -41,7 +40,6 @@
} }
&.bs-tooltip-bottom { &.bs-tooltip-bottom {
padding: $tooltip-arrow-width 0; padding: $tooltip-arrow-width 0;
margin-top: $tooltip-margin;
.arrow::before { .arrow::before {
top: 0; top: 0;
@ -54,7 +52,6 @@
} }
&.bs-tooltip-left { &.bs-tooltip-left {
padding: 0 $tooltip-arrow-width; padding: 0 $tooltip-arrow-width;
margin-left: -$tooltip-margin;
.arrow::before { .arrow::before {
top: 50%; top: 50%;

View File

@ -696,7 +696,7 @@ $tooltip-bg: $black !default;
$tooltip-opacity: .9 !default; $tooltip-opacity: .9 !default;
$tooltip-padding-y: 3px !default; $tooltip-padding-y: 3px !default;
$tooltip-padding-x: 8px !default; $tooltip-padding-x: 8px !default;
$tooltip-margin: 3px !default; $tooltip-margin: 0 !default;
$tooltip-arrow-width: 5px !default; $tooltip-arrow-width: 5px !default;
$tooltip-arrow-color: $tooltip-bg !default; $tooltip-arrow-color: $tooltip-bg !default;