modular.html 2.3 KB

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