mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-19 16:54:24 +01:00
Reset text/font properties more thoroughly for tooltips+popovers; fixes #15925
[skip sauce]
This commit is contained in:
parent
1bc9fb626c
commit
5359cb8054
@ -11,6 +11,7 @@
|
|||||||
@import "mixins/responsive-visibility.less";
|
@import "mixins/responsive-visibility.less";
|
||||||
@import "mixins/size.less";
|
@import "mixins/size.less";
|
||||||
@import "mixins/tab-focus.less";
|
@import "mixins/tab-focus.less";
|
||||||
|
@import "mixins/reset-text.less";
|
||||||
@import "mixins/text-emphasis.less";
|
@import "mixins/text-emphasis.less";
|
||||||
@import "mixins/text-overflow.less";
|
@import "mixins/text-overflow.less";
|
||||||
@import "mixins/vendor-prefixes.less";
|
@import "mixins/vendor-prefixes.less";
|
||||||
|
18
less/mixins/reset-text.less
Normal file
18
less/mixins/reset-text.less
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
.reset-text() {
|
||||||
|
font-family: @font-family-base;
|
||||||
|
// We deliberately do NOT reset font-size.
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: normal;
|
||||||
|
letter-spacing: normal;
|
||||||
|
line-break: auto;
|
||||||
|
line-height: @line-height-base;
|
||||||
|
text-align: left; // Fallback for where `start` is not supported
|
||||||
|
text-align: start;
|
||||||
|
text-decoration: none;
|
||||||
|
text-shadow: none;
|
||||||
|
text-transform: none;
|
||||||
|
white-space: normal;
|
||||||
|
word-break: normal;
|
||||||
|
word-spacing: normal;
|
||||||
|
word-wrap: normal;
|
||||||
|
}
|
@ -11,12 +11,11 @@
|
|||||||
display: none;
|
display: none;
|
||||||
max-width: @popover-max-width;
|
max-width: @popover-max-width;
|
||||||
padding: 1px;
|
padding: 1px;
|
||||||
// Reset font and text properties given new insertion method
|
// Our parent element can be arbitrary since popovers are by default inserted as a sibling of their target element.
|
||||||
font-family: @font-family-base;
|
// So reset our font and text properties to avoid inheriting weird values.
|
||||||
|
.reset-text();
|
||||||
font-size: @font-size-base;
|
font-size: @font-size-base;
|
||||||
font-weight: normal;
|
|
||||||
line-height: @line-height-base;
|
|
||||||
text-align: left;
|
|
||||||
background-color: @popover-bg;
|
background-color: @popover-bg;
|
||||||
background-clip: padding-box;
|
background-clip: padding-box;
|
||||||
border: 1px solid @popover-fallback-border-color;
|
border: 1px solid @popover-fallback-border-color;
|
||||||
@ -24,9 +23,6 @@
|
|||||||
border-radius: @border-radius-large;
|
border-radius: @border-radius-large;
|
||||||
.box-shadow(0 5px 10px rgba(0,0,0,.2));
|
.box-shadow(0 5px 10px rgba(0,0,0,.2));
|
||||||
|
|
||||||
// Overrides for proper insertion
|
|
||||||
white-space: normal;
|
|
||||||
|
|
||||||
// Offset the popover to account for the popover arrow
|
// Offset the popover to account for the popover arrow
|
||||||
&.top { margin-top: -@popover-arrow-width; }
|
&.top { margin-top: -@popover-arrow-width; }
|
||||||
&.right { margin-left: @popover-arrow-width; }
|
&.right { margin-left: @popover-arrow-width; }
|
||||||
|
@ -8,12 +8,11 @@
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: @zindex-tooltip;
|
z-index: @zindex-tooltip;
|
||||||
display: block;
|
display: block;
|
||||||
// Reset font and text properties given new insertion method
|
// Our parent element can be arbitrary since tooltips are by default inserted as a sibling of their target element.
|
||||||
font-family: @font-family-base;
|
// So reset our font and text properties to avoid inheriting weird values.
|
||||||
|
.reset-text();
|
||||||
font-size: @font-size-small;
|
font-size: @font-size-small;
|
||||||
font-weight: normal;
|
|
||||||
line-height: @line-height-base;
|
|
||||||
text-decoration: none;
|
|
||||||
.opacity(0);
|
.opacity(0);
|
||||||
|
|
||||||
&.in { .opacity(@tooltip-opacity); }
|
&.in { .opacity(@tooltip-opacity); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user