icon.html 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. ---
  2. layout: documentation
  3. doc-tab: elements
  4. doc-subtab: icon
  5. ---
  6. {% include subnav-elements.html %}
  7. <section class="section">
  8. <div class="container">
  9. <h1 class="title">Icons</h1>
  10. <h2 class="subtitle">
  11. Bulma is compatible with <strong><a href="http://fortawesome.github.io/Font-Awesome/">Font Awesome</a></strong> icons.
  12. </h2>
  13. <hr>
  14. <div class="content">
  15. <p>Because the icons can take a few seconds to load, and because you want control over the <strong>space</strong> the icons will take, you can use the <code>icon</code> class as a container:</p>
  16. </div>
  17. {% capture icon_example %}
  18. <span class="icon">
  19. <i class="fa fa-home"></i>
  20. </span>
  21. {% endcapture %}
  22. <div class="example">
  23. {{icon_example}}
  24. </div>
  25. {% highlight html %}
  26. {{icon_example}}
  27. {% endhighlight %}
  28. <div class="content">
  29. <p>The <code>icon</code> container will take up <em>exactly</em> <strong>1.5rem x 1.5rem</strong>. The icon itself is sized at <strong>21px</strong>.</p>
  30. </div>
  31. <hr>
  32. <h3 class="title">Sizes</h3>
  33. <div class="content">
  34. <p>Font Awesome icons use a font-size of <strong>28px</strong> by default, and are best rendered when using <strong>multiples of 7</strong>.</p>
  35. <p>The Bulma <code>icon</code> container is always slightly bigger than the font-size used:</p>
  36. </div>
  37. <table class="table">
  38. <thead>
  39. <tr>
  40. <th colspan="2">Class</th>
  41. <th>Font-size</th>
  42. <th>Container size</th>
  43. </tr>
  44. </thead>
  45. <tbody>
  46. <tr>
  47. <td><code>icon is-small</code></td>
  48. <td><span class="icon is-small"><i class="fa fa-home"></i></span></td>
  49. <td>14px</td>
  50. <td>1rem x 1rem</td>
  51. </tr>
  52. <tr>
  53. <td><code>icon</code></td>
  54. <td><span class="icon"><i class="fa fa-home"></i></span></td>
  55. <td>21px</td>
  56. <td>1.5rem x 1.5rem</td>
  57. </tr>
  58. <tr>
  59. <td><code>icon is-medium</code></td>
  60. <td><span class="icon is-medium"><i class="fa fa-home"></i></span></td>
  61. <td>28px</td>
  62. <td>2rem x 2rem</td>
  63. </tr>
  64. <tr>
  65. <td><code>icon is-large</code></td>
  66. <td><span class="icon is-large"><i class="fa fa-home"></i></span></td>
  67. <td>42px</td>
  68. <td>3rem x 3rem</td>
  69. </tr>
  70. </tbody>
  71. </table>
  72. </div>
  73. </section>