modular.html 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. ---
  2. title: Modularity
  3. layout: documentation
  4. doc-tab: overview
  5. doc-subtab: modular
  6. ---
  7. {% include subnav-overview.html %}
  8. <section class="section">
  9. <div class="container">
  10. <h1 class="title">Modular</h1>
  11. <h2 class="subtitle">Just import what you <strong>need</strong></h2>
  12. <hr>
  13. <div class="content">
  14. <p>
  15. Bulma consists of <strong>29</strong> <code>.sass</code> files that you can import <strong>individually.</strong>
  16. </p>
  17. <p>
  18. For example, let's say you only want the Bulma <strong>columns.</strong>
  19. <br>
  20. The file is located in the <code>bulma/sass/grid</code> folder.
  21. <br>
  22. Simply <strong>import</strong> the utilities dependencies, and then the files you need directly:
  23. </p>
  24. {% highlight sass %}
  25. @import "bulma/sass/utilities/_all"
  26. @import "bulma/sass/grid/columns"
  27. {% endhighlight %}
  28. <p>
  29. Now you can use the classes <code>.columns</code> (for the container) and <code>.column</code> directly:
  30. </p>
  31. {% highlight html %}
  32. <div class="columns">
  33. <div class="column">1</div>
  34. <div class="column">2</div>
  35. <div class="column">3</div>
  36. <div class="column">4</div>
  37. <div class="column">5</div>
  38. </div>
  39. {% endhighlight %}
  40. <hr>
  41. <p>
  42. What if you only want the <strong>button</strong> styles instead?
  43. </p>
  44. {% highlight sass %}
  45. @import "bulma/sass/utilities/_all"
  46. @import "bulma/sass/elements/button.sass"
  47. {% endhighlight %}
  48. <p>
  49. You can now use the <code>.button</code> class, and all its modifiers:
  50. </p>
  51. <ul>
  52. <li>
  53. <code>.is-active</code>
  54. </li>
  55. <li>
  56. <code>.is-primary</code>,
  57. <code>.is-info</code>,
  58. <code>.is-success</code>...
  59. </li>
  60. <li>
  61. <code>.is-small</code>,
  62. <code>.is-medium</code>,
  63. <code>.is-large</code>
  64. </li>
  65. <li>
  66. <code>.is-outlined</code>,
  67. <code>.is-inverted</code>,
  68. <code>.is-link</code>
  69. </li>
  70. <li>
  71. <code>.is-loading</code>,
  72. <code>[disabled]</code>
  73. </li>
  74. </ul>
  75. {% highlight html %}
  76. <a class="button">
  77. Button
  78. </a>
  79. <a class="button is-primary">
  80. Primary button
  81. </a>
  82. <a class="button is-large">
  83. Large button
  84. </a>
  85. <a class="button is-loading">
  86. Loading button
  87. </a>
  88. {% endhighlight %}
  89. </div>
  90. </div>
  91. </section>