modular.html 2.3 KB

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