icon.html 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. {% include snippet.html content=icon_example %}
  39. <div class="content">
  40. <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>
  41. </div>
  42. {% include anchor.html name="Sizes" %}
  43. <div class="content">
  44. <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>
  45. <p>The Bulma <code>icon</code> container is always slightly bigger than the font-size used:</p>
  46. </div>
  47. <table class="table">
  48. <thead>
  49. <tr>
  50. <th colspan="2">Class</th>
  51. <th>Font-size</th>
  52. <th>Container size</th>
  53. </tr>
  54. </thead>
  55. <tbody>
  56. <tr>
  57. <td><code>icon is-small</code></td>
  58. <td><span class="icon is-small"><i class="fa fa-home"></i></span></td>
  59. <td>14px</td>
  60. <td>1rem x 1rem</td>
  61. </tr>
  62. <tr>
  63. <td><code>icon</code></td>
  64. <td><span class="icon"><i class="fa fa-home"></i></span></td>
  65. <td>21px</td>
  66. <td>1.5rem x 1.5rem</td>
  67. </tr>
  68. <tr>
  69. <td><code>icon is-medium</code></td>
  70. <td><span class="icon is-medium"><i class="fa fa-home"></i></span></td>
  71. <td>28px</td>
  72. <td>2rem x 2rem</td>
  73. </tr>
  74. <tr>
  75. <td><code>icon is-large</code></td>
  76. <td><span class="icon is-large"><i class="fa fa-home"></i></span></td>
  77. <td>42px</td>
  78. <td>3rem x 3rem</td>
  79. </tr>
  80. </tbody>
  81. </table>
  82. {% include variables.html %}
  83. </div>
  84. </section>