Bulma: Icons not aligning with text.

Created on 21 Jan 2017  路  11Comments  路  Source: jgthms/bulma

Looks like bug from #224 has returned?

screen shot 2017-01-20 at 19 06 33 pm

Chrome 55
Bulma 0.3.1
Mac w/ Sierra

<p>
    <strong class="is-block">Point of Contact</strong>
    <span class="icon is-small"><i class="fa fa-envelope"></i></span> John Doe
    <br>
    <span class="icon is-small"><i class="fa fa-phone"></i></span> (555) 555-5555
    <br>
    <span class="icon is-small"><i class="fa fa-fax"></i></span> (555) 555-5556
</p>

Most helpful comment

Any update on this ?

All 11 comments

screen shot 2017-01-26 at 08 56 31

Same here.

Started using bulma just a few days ago and this is already a pretty big flaw, if it's not something I've overlooked.

https://github.com/jgthms/bulma/blob/35a488031e8f9db40426d0bffafeee83c5b3ea1a/sass/elements/icon.sass#L6

Why is this a thing?

The vertical-align: top is there to prevent the .icon element to use more space than its height. Otherwise there's a gap below:
image

Solution would be to have a modifier class to remove that alignment on some icons.

@jgthms I am guessing I am doing something wrong. But it seems like without vertical-align it looks completely broken.
screen shot 2018-01-26 at 5 47 56 pm

Settings vertical-align: center makes it better. Not perfect. Is this intended?

What's the appropriate way to align icons with text? When I place an icon before some text with no modifications, this is the result?

screen shot 2018-03-09 at 11 31 53 am

The image above is from the following code:

<div class="notification is-warning" v-else>
    <span class="icon is-medium">
        <i class="fas fa-2x fa-exclamation-circle"></i>
    </span>
    This is an warning message.
</div>

Adding a vertical-align: middle; to the .icon, helps a little, but still not perfect:

<div class="notification is-warning" v-else>
    <span class="icon is-medium" style="vertical-align:middle;">
        <i class="fas fa-2x fa-exclamation-circle"></i>
    </span>
    This is an warning message.
</div>

screen shot 2018-03-09 at 11 31 12 am

What is the appropriate way to accomplish this? Should this be the default behavior rather than having to add css to make it work? If it does require custom code, what is the recommended way to get perfect alignment?

Any update on this ?

broken as shit

Hey so for everyone who is encountering this issue, you can just change display: inline-flex; from the icon class to display: inline-table; or display: inline-block;. Fixed it for me, just add a bit more margin so that it looks nice.

bildschirmfoto 2018-06-03 um 00 23 41

display: inline-flex;

bildschirmfoto 2018-06-03 um 00 23 50

display: inline-table;

Any update?

Any update ?

See #1858

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fundon picture fundon  路  3Comments

choonggg picture choonggg  路  3Comments

dotMastaz picture dotMastaz  路  3Comments

swamikevala picture swamikevala  路  3Comments

JenCant picture JenCant  路  3Comments