From 07a5d55f01c826c136b58c89907be76a203d5eaa Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Mon, 16 Mar 2015 14:41:03 -0700 Subject: [PATCH 1/3] tooltip: line-height: 1.4 => @line-height-base --- less/tooltip.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/less/tooltip.less b/less/tooltip.less index 9d5684743309..c0dfd55ce1ae 100644 --- a/less/tooltip.less +++ b/less/tooltip.less @@ -12,7 +12,7 @@ font-family: @font-family-base; font-size: @font-size-small; font-weight: normal; - line-height: 1.4; + line-height: @line-height-base; .opacity(0); &.in { .opacity(@tooltip-opacity); } From 1bc9fb626c7f1829c3e86969a206091d93addca7 Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Mon, 16 Mar 2015 14:47:07 -0700 Subject: [PATCH 2/3] hoist text-decoration reset up from .tooltip-inner to .tooltip --- less/tooltip.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/less/tooltip.less b/less/tooltip.less index c0dfd55ce1ae..90207b54a680 100644 --- a/less/tooltip.less +++ b/less/tooltip.less @@ -13,6 +13,7 @@ font-size: @font-size-small; font-weight: normal; line-height: @line-height-base; + text-decoration: none; .opacity(0); &.in { .opacity(@tooltip-opacity); } @@ -28,7 +29,6 @@ padding: 3px 8px; color: @tooltip-color; text-align: center; - text-decoration: none; background-color: @tooltip-bg; border-radius: @border-radius-base; } From 5359cb805439a6e3179fdd46d2fb009babd0f01b Mon Sep 17 00:00:00 2001 From: Chris Rebert Date: Mon, 16 Mar 2015 14:48:49 -0700 Subject: [PATCH 3/3] Reset text/font properties more thoroughly for tooltips+popovers; fixes #15925 [skip sauce] --- less/mixins.less | 1 + less/mixins/reset-text.less | 18 ++++++++++++++++++ less/popovers.less | 12 ++++-------- less/tooltip.less | 9 ++++----- 4 files changed, 27 insertions(+), 13 deletions(-) create mode 100644 less/mixins/reset-text.less diff --git a/less/mixins.less b/less/mixins.less index af4408fc2d68..e6f9fe684b7a 100644 --- a/less/mixins.less +++ b/less/mixins.less @@ -11,6 +11,7 @@ @import "mixins/responsive-visibility.less"; @import "mixins/size.less"; @import "mixins/tab-focus.less"; +@import "mixins/reset-text.less"; @import "mixins/text-emphasis.less"; @import "mixins/text-overflow.less"; @import "mixins/vendor-prefixes.less"; diff --git a/less/mixins/reset-text.less b/less/mixins/reset-text.less new file mode 100644 index 000000000000..58dd4d19b4d1 --- /dev/null +++ b/less/mixins/reset-text.less @@ -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; +} diff --git a/less/popovers.less b/less/popovers.less index 2748eead13fa..3a62a6455ac1 100644 --- a/less/popovers.less +++ b/less/popovers.less @@ -11,12 +11,11 @@ display: none; max-width: @popover-max-width; padding: 1px; - // Reset font and text properties given new insertion method - font-family: @font-family-base; + // Our parent element can be arbitrary since popovers are by default inserted as a sibling of their target element. + // So reset our font and text properties to avoid inheriting weird values. + .reset-text(); font-size: @font-size-base; - font-weight: normal; - line-height: @line-height-base; - text-align: left; + background-color: @popover-bg; background-clip: padding-box; border: 1px solid @popover-fallback-border-color; @@ -24,9 +23,6 @@ border-radius: @border-radius-large; .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 &.top { margin-top: -@popover-arrow-width; } &.right { margin-left: @popover-arrow-width; } diff --git a/less/tooltip.less b/less/tooltip.less index 90207b54a680..b48d63e07ad8 100644 --- a/less/tooltip.less +++ b/less/tooltip.less @@ -8,12 +8,11 @@ position: absolute; z-index: @zindex-tooltip; display: block; - // Reset font and text properties given new insertion method - font-family: @font-family-base; + // 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. + .reset-text(); font-size: @font-size-small; - font-weight: normal; - line-height: @line-height-base; - text-decoration: none; + .opacity(0); &.in { .opacity(@tooltip-opacity); }