1
0
Fork 0
mirror of https://github.com/twbs/bootstrap.git synced 2022-11-09 12:25:43 -05:00

Fixes #4852: IE8 popover carets fixed

* IE8 refused a negative z-index to place the previous :after behind the .arrow, so I had to flip the styles.
* .arrow is the gray border/background, .arrow:after is now the white inner arrow
* Added a hex IE8 fallback to ensure the arrow shows for <IE9 as rgba() isn't supported
* Simplified some of the CSS for the popover carets
This commit is contained in:
Mark Otto 2012-11-28 01:38:21 -08:00
parent fda5bb135e
commit bfc97fdaf6
2 changed files with 178 additions and 40 deletions

View file

@ -5316,76 +5316,144 @@ input[type="submit"].btn.btn-mini {
.popover .arrow, .popover .arrow,
.popover .arrow:after { .popover .arrow:after {
position: absolute; position: absolute;
display: inline-block; display: block;
width: 0; width: 0;
height: 0; height: 0;
border-color: transparent; border-color: transparent;
border-style: solid; border-style: solid;
} }
.popover .arrow {
border-width: 11px;
}
.popover .arrow:after { .popover .arrow:after {
z-index: -1; border-width: 10px;
content: ""; content: "";
} }
.popover.top .arrow { .popover {
bottom: -10px; /*
&.top .arrow {
bottom: -@popoverArrowWidth;
left: 50%; left: 50%;
margin-left: -10px; margin-left: -@popoverArrowWidth;
border-top-color: #ffffff; border-width: @popoverArrowWidth @popoverArrowWidth 0;
border-width: 10px 10px 0; //border-top-color: @popoverArrowColor;
border-top-color: blue;
&:after {
border-width: @popoverArrowOuterWidth @popoverArrowOuterWidth 0;
//border-top-color: @popoverArrowOuterColor;
border-top-color: red;
top: -@popoverArrowWidth;
//bottom: -1px;
left: -@popoverArrowOuterWidth;
}
}
&.right .arrow {
top: 50%;
left: -@popoverArrowWidth;
margin-top: -@popoverArrowWidth;
border-width: @popoverArrowWidth @popoverArrowWidth @popoverArrowWidth 0;
border-right-color: @popoverArrowColor;
&:after {
border-width: @popoverArrowOuterWidth @popoverArrowOuterWidth @popoverArrowOuterWidth 0;
border-right-color: @popoverArrowOuterColor;
bottom: -@popoverArrowOuterWidth;
left: -1px;
}
}
&.bottom .arrow {
top: -@popoverArrowWidth;
left: 50%;
margin-left: -@popoverArrowWidth;
border-width: 0 @popoverArrowWidth @popoverArrowWidth;
border-bottom-color: @popoverArrowColor;
&:after {
border-width: 0 @popoverArrowOuterWidth @popoverArrowOuterWidth;
border-bottom-color: @popoverArrowOuterColor;
top: -1px;
left: -@popoverArrowOuterWidth;
}
}
&.left .arrow {
top: 50%;
right: -@popoverArrowWidth;
margin-top: -@popoverArrowWidth;
border-width: @popoverArrowWidth 0 @popoverArrowWidth @popoverArrowWidth;
border-left-color: @popoverArrowColor;
&:after {
border-width: @popoverArrowOuterWidth 0 @popoverArrowOuterWidth @popoverArrowOuterWidth;
border-left-color: @popoverArrowOuterColor;
bottom: -@popoverArrowOuterWidth;
right: -1px;
}
}*/
}
.popover.top .arrow {
bottom: -11px;
left: 50%;
margin-left: -11px;
border-top-color: #999;
border-top-color: rgba(0, 0, 0, 0.25);
border-bottom-width: 0;
} }
.popover.top .arrow:after { .popover.top .arrow:after {
bottom: -1px; bottom: 1px;
left: -11px; margin-left: -10px;
border-top-color: rgba(0, 0, 0, 0.25); border-top-color: #ffffff;
border-width: 11px 11px 0; border-bottom-width: 0;
} }
.popover.right .arrow { .popover.right .arrow {
top: 50%; top: 50%;
left: -10px; left: -11px;
margin-top: -10px; margin-top: -11px;
border-right-color: #ffffff; border-right-color: #999;
border-width: 10px 10px 10px 0; border-right-color: rgba(0, 0, 0, 0.25);
border-left-width: 0;
} }
.popover.right .arrow:after { .popover.right .arrow:after {
bottom: -11px; bottom: -10px;
left: -1px; left: 1px;
border-right-color: rgba(0, 0, 0, 0.25); border-right-color: #ffffff;
border-width: 11px 11px 11px 0; border-left-width: 0;
} }
.popover.bottom .arrow { .popover.bottom .arrow {
top: -10px; top: -11px;
left: 50%; left: 50%;
margin-left: -10px; margin-left: -11px;
border-bottom-color: #ffffff; border-bottom-color: #999;
border-width: 0 10px 10px; border-bottom-color: rgba(0, 0, 0, 0.25);
border-top-width: 0;
} }
.popover.bottom .arrow:after { .popover.bottom .arrow:after {
top: -1px; top: 1px;
left: -11px; margin-left: -10px;
border-bottom-color: rgba(0, 0, 0, 0.25); border-bottom-color: #ffffff;
border-width: 0 11px 11px; border-top-width: 0;
} }
.popover.left .arrow { .popover.left .arrow {
top: 50%; top: 50%;
right: -10px; right: -11px;
margin-top: -10px; margin-top: -11px;
border-left-color: #ffffff; border-left-color: #999;
border-width: 10px 0 10px 10px; border-left-color: rgba(0, 0, 0, 0.25);
border-right-width: 0;
} }
.popover.left .arrow:after { .popover.left .arrow:after {
right: -1px; right: 1px;
bottom: -11px; bottom: -10px;
border-left-color: rgba(0, 0, 0, 0.25); border-left-color: #ffffff;
border-width: 11px 0 11px 11px; border-right-width: 0;
} }
.thumbnails { .thumbnails {

View file

@ -49,31 +49,101 @@
} }
// Arrows // Arrows
//
// .arrow is outer, .arrow:after is inner
.popover .arrow, .popover .arrow,
.popover .arrow:after { .popover .arrow:after {
position: absolute; position: absolute;
display: inline-block; display: block;
width: 0; width: 0;
height: 0; height: 0;
border-color: transparent; border-color: transparent;
border-style: solid; border-style: solid;
} }
.popover .arrow {
border-width: @popoverArrowOuterWidth;
}
.popover .arrow:after { .popover .arrow:after {
border-width: @popoverArrowWidth;
content: ""; content: "";
z-index: -1;
} }
.popover { .popover {
&.top .arrow {
left: 50%;
margin-left: -@popoverArrowOuterWidth;
border-bottom-width: 0;
border-top-color: #999; // IE8 fallback
border-top-color: @popoverArrowOuterColor;
bottom: -@popoverArrowOuterWidth;
&:after {
bottom: 1px;
margin-left: -@popoverArrowWidth;
border-bottom-width: 0;
border-top-color: @popoverArrowColor;
}
}
&.right .arrow {
top: 50%;
left: -@popoverArrowOuterWidth;
margin-top: -@popoverArrowOuterWidth;
border-left-width: 0;
border-right-color: #999; // IE8 fallback
border-right-color: @popoverArrowOuterColor;
&:after {
left: 1px;
bottom: -@popoverArrowWidth;
border-left-width: 0;
border-right-color: @popoverArrowColor;
}
}
&.bottom .arrow {
left: 50%;
margin-left: -@popoverArrowOuterWidth;
border-top-width: 0;
border-bottom-color: #999; // IE8 fallback
border-bottom-color: @popoverArrowOuterColor;
top: -@popoverArrowOuterWidth;
&:after {
top: 1px;
margin-left: -@popoverArrowWidth;
border-top-width: 0;
border-bottom-color: @popoverArrowColor;
}
}
&.left .arrow {
top: 50%;
right: -@popoverArrowOuterWidth;
margin-top: -@popoverArrowOuterWidth;
border-right-width: 0;
border-left-color: #999; // IE8 fallback
border-left-color: @popoverArrowOuterColor;
&:after {
right: 1px;
border-right-width: 0;
border-left-color: @popoverArrowColor;
bottom: -@popoverArrowWidth;
}
}
/*
&.top .arrow { &.top .arrow {
bottom: -@popoverArrowWidth; bottom: -@popoverArrowWidth;
left: 50%; left: 50%;
margin-left: -@popoverArrowWidth; margin-left: -@popoverArrowWidth;
border-width: @popoverArrowWidth @popoverArrowWidth 0; border-width: @popoverArrowWidth @popoverArrowWidth 0;
border-top-color: @popoverArrowColor; //border-top-color: @popoverArrowColor;
border-top-color: blue;
&:after { &:after {
border-width: @popoverArrowOuterWidth @popoverArrowOuterWidth 0; border-width: @popoverArrowOuterWidth @popoverArrowOuterWidth 0;
border-top-color: @popoverArrowOuterColor; //border-top-color: @popoverArrowOuterColor;
bottom: -1px; border-top-color: red;
top: -@popoverArrowWidth;
//bottom: -1px;
left: -@popoverArrowOuterWidth; left: -@popoverArrowOuterWidth;
} }
} }
@ -115,5 +185,5 @@
bottom: -@popoverArrowOuterWidth; bottom: -@popoverArrowOuterWidth;
right: -1px; right: -1px;
} }
} }*/
} }