Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltips and popovers still inherit font-style and others #15925

Closed
natevw opened this issue Feb 25, 2015 · 2 comments · Fixed by #16086
Closed

Tooltips and popovers still inherit font-style and others #15925

natevw opened this issue Feb 25, 2015 · 2 comments · Fixed by #16086

Comments

@natevw
Copy link

natevw commented Feb 25, 2015

In Bootstrap v3.3.1 many of the font settings were properly reset for tooltip/popover content via 2862c30. I'm glad the decision was made in this direction, to reset font/text back to defaults within the content — but the implementation was incomplete. For example, we noticed already that a popover within font-style: italic text has its contents still italic. So #15046 does not seem fully resolved yet.

In case it's helpful, here's a LESS snippet (including a link that could lead you to a relevant reference) that I used for resetting fonts in a non-Bootstrap project:

.reset-text(@fontsize) {    // used to avoid unwanted inheritance of text-related styles from a parent
    // most of this list is based on properties first-line applies to [NOTE: hasn't been exhaustively reviewed]
    // see https://developer.mozilla.org/en-US/docs/Web/CSS/::first-line (and W3C spec) for more details
    font-style: normal; font-variant: normal; font-weight: normal; line-height: normal;
    font-size: @fontsize;
    // font, font-family omitted
    color: black;
    word-spacing: normal; letter-spacing: normal; text-decoration: none; text-transform: none;
    text-shadow: none;

    // some other properties added in as well
    text-indent: 0;
    text-align: left; text-align: start;
}

Note that the snippet above is not exhaustive (it likely covers only the properties we used/anticipated in this particular app and/or predates more properties being added to the spec) but hopefully a more thorough start — not to mention perhaps the idea to encapsulate all the reset in a reusable LESS mixin is valuable.

@kkirsche
Copy link
Contributor

Would I be correct that this would essentially be set as a mixin on the .tooltip and .popover base classes to "default" the text, then overwrite them with our specific values?

@natevw
Copy link
Author

natevw commented Feb 26, 2015

Yes, although you may just wish to default to your own (Bootstrap defaults) in your version of the mixin, rather than trying to fully reset all the properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants