modular.html 2.3 KB

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