-
Notifications
You must be signed in to change notification settings - Fork 12.2k
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
Font Awesome icon placement when used in Bootstrap input with feedback #4313
Comments
@traviswatsonws Thanks for reporting this Altough FA is declared as "designed for bootstrap", dave preferred to remove framework specific workarounds in FA 4.0. You made the right choice. Otherwise, you should override some values but you should be careful because that will also affect A better approach would be change I don't know where to document this, maybe a new section |
Waiting for the fix. |
@nghuuphuoc The fix I mentioned (loading FontAwesome then Bootstrap, letting BS cascade over FA) worked well for me. The project shipped with this change, and I saw no issues related to it. I can't guarantee there aren't other side effects of that order, but I didn't see any. |
@traviswatsonws Thanks for the simple "fix". Saved me from venturing down a dark path. |
What is the best way to approach this one now? I'm using the latest fa and bootstrap. |
fastest approach: #4313 (comment) |
@tagliala thanks thats great |
My favorite workaround without BS or FA override nor changing the <div class="form-group has-feedback">
<label class="control-label">Font Awesome</label>
<input type="text" class="form-control">
<span class="form-control-feedback">
<i class="fa fa-search"></i>
</span>
</div> |
@Azaret thanks for sharing this! |
Thanks @Azaret! Great fix until the official one. |
Just started this wiki, feel free to improve it: https://github.com/FortAwesome/Font-Awesome/wiki/Bootstrap-Caveats |
@Azaret Thank you very much! |
@Azaret Thank you! |
@Azaret Thx! |
@milanvdm, Bootstrap 4 uses background images for validation feedback. For example, https://github.com/twbs/bootstrap/blob/v4-dev/scss/_variables.scss#L541 . Bootstrap 3https://jsfiddle.net/kezkankrayon/g9sx0ahr/
Bootstrap 4https://jsfiddle.net/kezkankrayon/mo5mhLtn/
|
Thanks a lot, that makes a lot of sense. Could you explain a bit more in detail what you mean with the bootstrap 4 variables? As I would like to adapt it to a fully working sccs file for Bootstrap 4. |
So I currently calculated the variables as follows based on the bootstrap 3 LESS (http://getbootstrap.com/customize/):
But this puts the eye quite a lot under the form. Im curious on how those variables could be calculated correctly using bootstrap 4 and scss? |
Edit: Use the fix from @Azaret below, it works great!
When attempting to use Font-Awesome icons within a Bootstrap input with feedback, the placement is off:
Font-Awesome is overwriting a couple of rules that fix this alignment:
The workaround I'm currently using is to place the Font-Awesome
<link>
above Bootstrap to give thefa
rules a lower precedence. Here's a snippet to reproduce (or in a codepen if you prefer):The text was updated successfully, but these errors were encountered: