with-sass-cli.html 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. ---
  2. title: With sass-cli
  3. layout: documentation
  4. doc-tab: customize
  5. doc-subtab: sass-cli
  6. breadcrumb:
  7. - home
  8. - documentation
  9. - customize
  10. - customize-sass-cli
  11. ---
  12. {% capture gem_install %}
  13. gem install sass
  14. {% endcapture %}
  15. {% capture gem_test %}
  16. Sass 3.5.3 (Bleeding Edge)
  17. {% endcapture %}
  18. {% capture step_1 %}
  19. <div class="content">
  20. <p>
  21. In your terminal, create a new folder called <code>mybulma</code>, navigate to it, then install the <strong>Sass gem</strong>:
  22. </p>
  23. </div>
  24. {% highlight bash %}{{ gem_install }}{% endhighlight %}
  25. <div class="content">
  26. <p>
  27. To try it out, run <code>sass -v</code> and you should see the following:
  28. </p>
  29. </div>
  30. {% highlight bash %}{{ gem_test }}{% endhighlight %}
  31. <div class="message is-info">
  32. <div class="message-body">
  33. <p>
  34. If you are on <strong>Windows</strong> and use <strong>Chocolatey</strong>, you can try <code>choco install sass</code>.
  35. </p>
  36. <p>
  37. If you are on <strong>Mac</strong> and use <strong>Homebrew</strong>, you can try <code>brew install sass/sass/sass</code>.
  38. </p>
  39. </div>
  40. </div>
  41. {% endcapture %}
  42. {% capture step_2 %}
  43. <div class="content">
  44. <p>
  45. Get the latest version of Bulma:
  46. </p>
  47. <p>
  48. <a class="button is-primary" href="{{ site.data.meta.download }}">
  49. <strong>Download</strong>
  50. </a>
  51. </p>
  52. <p>
  53. Unzip it and put the <code>bulma-{{ site.data.meta.version }}</code> folder inside your <code>mybulma</code> folder.
  54. </p>
  55. </div>
  56. {% endcapture %}
  57. {% capture build_sass %}
  58. sass --sourcemap=none sass/mystyles.scss:css/mystyles.css
  59. {% endcapture %}
  60. {% capture watch_sass %}
  61. sass --watch --sourcemap=none sass/mystyles.scss:css/mystyles.css
  62. {% endcapture %}
  63. {% capture step_5 %}
  64. <div class="content">
  65. <p>
  66. In your terminal, type the following command:
  67. </p>
  68. </div>
  69. {% highlight bash %}{{ build_sass }}{% endhighlight %}
  70. <div class="content">
  71. <p>
  72. <strong>Reload</strong> the page and it should be styled like this:
  73. </p>
  74. </div>
  75. {%
  76. include components/figure.html
  77. path="customize/custom-bulma-02-default"
  78. extension="png"
  79. alt="Bulma default styles"
  80. width="600"
  81. height="300"
  82. caption="Bulma's default styles"
  83. %}
  84. <div class="content">
  85. <p>
  86. To <strong>watch for changes</strong>, just launch the following command:
  87. </p>
  88. </div>
  89. {% highlight bash %}{{ watch_sass }}{% endhighlight %}
  90. {% endcapture %}
  91. {% include components/step.html
  92. title='1. Install Sass'
  93. content=step_1
  94. %}
  95. <hr>
  96. {% include components/step.html
  97. title='2. Download Bulma'
  98. content=step_2
  99. %}
  100. <hr>
  101. {% assign bulma_path = site.data.meta.version | prepend: "../bulma-" %}
  102. {% include steps/create-sass-file.html
  103. number="3"
  104. path=bulma_path
  105. %}
  106. <hr>
  107. {% include steps/create-html-page.html
  108. number="4"
  109. %}
  110. <hr>
  111. {% include components/step.html
  112. title='5. Build the CSS file'
  113. content=step_5
  114. %}
  115. <hr>
  116. {% include steps/add-custom-styles.html
  117. number="6"
  118. %}