0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-01 13:24:25 +01:00

Convert tooltip's arrows to generated CSS content via :before

This commit is contained in:
Bernardo Gurgel Filho 2015-08-23 01:59:48 -03:00
parent 7ff9b1979c
commit 2ae5fdf9dd
2 changed files with 15 additions and 13 deletions

View File

@ -28,7 +28,6 @@ const Tooltip = (($) => {
const Default = {
animation : true,
template : '<div class="tooltip" role="tooltip">'
+ '<div class="tooltip-arrow"></div>'
+ '<div class="tooltip-inner"></div></div>',
trigger : 'hover focus',
title : '',

View File

@ -16,10 +16,11 @@
padding: $tooltip-arrow-width 0;
margin-top: -3px;
.tooltip-arrow {
.tooltip-inner:before {
bottom: 0;
left: 50%;
margin-left: -$tooltip-arrow-width;
content: "";
border-width: $tooltip-arrow-width $tooltip-arrow-width 0;
border-top-color: $tooltip-arrow-color;
}
@ -29,10 +30,11 @@
padding: 0 $tooltip-arrow-width;
margin-left: 3px;
.tooltip-arrow {
.tooltip-inner:before {
top: 50%;
left: 0;
margin-top: -$tooltip-arrow-width;
content: "";
border-width: $tooltip-arrow-width $tooltip-arrow-width $tooltip-arrow-width 0;
border-right-color: $tooltip-arrow-color;
}
@ -42,10 +44,11 @@
padding: $tooltip-arrow-width 0;
margin-top: 3px;
.tooltip-arrow {
.tooltip-inner:before {
top: 0;
left: 50%;
margin-left: -$tooltip-arrow-width;
content: "";
border-width: 0 $tooltip-arrow-width $tooltip-arrow-width;
border-bottom-color: $tooltip-arrow-color;
}
@ -55,10 +58,11 @@
padding: 0 $tooltip-arrow-width;
margin-left: -3px;
.tooltip-arrow {
.tooltip-inner:before {
top: 50%;
right: 0;
margin-top: -$tooltip-arrow-width;
content: "";
border-width: $tooltip-arrow-width 0 $tooltip-arrow-width $tooltip-arrow-width;
border-left-color: $tooltip-arrow-color;
}
@ -73,13 +77,12 @@
text-align: center;
background-color: $tooltip-bg;
@include border-radius($border-radius);
}
// Arrows
.tooltip-arrow {
position: absolute;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
&:before {
position: absolute;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
}
}