icon.html 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. ---
  2. title: Icon
  3. layout: documentation
  4. doc-tab: elements
  5. doc-subtab: icon
  6. variables:
  7. - name: $icon-dimensions
  8. value: 1.5rem
  9. - name: $icon-dimensions-small
  10. value: 1rem
  11. - name: $icon-dimensions-medium
  12. value: 2rem
  13. - name: $icon-dimensions-large
  14. value: 3rem
  15. ---
  16. {% capture icon_example %}
  17. <span class="icon">
  18. <i class="fa fa-home"></i>
  19. </span>
  20. {% endcapture %}
  21. {% include subnav-elements.html %}
  22. <section class="section">
  23. <div class="container">
  24. <h1 class="title">Icons</h1>
  25. <h2 class="subtitle">
  26. Bulma is compatible with <strong><a href="http://fortawesome.github.io/Font-Awesome/">Font Awesome</a></strong> icons.
  27. </h2>
  28. {%
  29. include meta.html
  30. colors=false
  31. sizes=true
  32. variables=true
  33. %}
  34. <hr>
  35. <div class="content">
  36. <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>
  37. </div>
  38. <div class="bd-example">
  39. {{icon_example}}
  40. </div>
  41. {% highlight html %}{{icon_example}}{% endhighlight %}
  42. <div class="content">
  43. <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>
  44. </div>
  45. {% include heading.html name="Sizes" %}
  46. <div class="content">
  47. <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>
  48. <p>The Bulma <code>icon</code> container is always slightly bigger than the font-size used:</p>
  49. </div>
  50. <table class="table">
  51. <thead>
  52. <tr>
  53. <th colspan="2">Class</th>
  54. <th>Font-size</th>
  55. <th>Container size</th>
  56. </tr>
  57. </thead>
  58. <tbody>
  59. <tr>
  60. <td><code>icon is-small</code></td>
  61. <td><span class="icon is-small"><i class="fa fa-home"></i></span></td>
  62. <td>14px</td>
  63. <td>1rem x 1rem</td>
  64. </tr>
  65. <tr>
  66. <td><code>icon</code></td>
  67. <td><span class="icon"><i class="fa fa-home"></i></span></td>
  68. <td>21px</td>
  69. <td>1.5rem x 1.5rem</td>
  70. </tr>
  71. <tr>
  72. <td><code>icon is-medium</code></td>
  73. <td><span class="icon is-medium"><i class="fa fa-home"></i></span></td>
  74. <td>28px</td>
  75. <td>2rem x 2rem</td>
  76. </tr>
  77. <tr>
  78. <td><code>icon is-large</code></td>
  79. <td><span class="icon is-large"><i class="fa fa-home"></i></span></td>
  80. <td>42px</td>
  81. <td>3rem x 3rem</td>
  82. </tr>
  83. </tbody>
  84. </table>
  85. {% include variables.html %}
  86. </div>
  87. </section>