customize.html 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. ---
  2. layout: documentation
  3. doc-tab: overview
  4. doc-subtab: customize
  5. ---
  6. {% capture sass %}
  7. // 1. Import the initial variables
  8. @import "../sass/utilities/initial-variables"
  9. // 2. Set your own initial variables
  10. // Update blue
  11. $blue: #72d0eb
  12. // Add pink and its invert
  13. $pink: #ffb3b3
  14. $pink-invert: #fff
  15. // Add a serif family
  16. $family-serif: "Merriweather", "Georgia", serif
  17. // 3. Set the derived variables
  18. // Use the new pink as the primary color
  19. $primary: $pink
  20. $primary-invert: $pink-invert
  21. // Use the existing orange as the danger color
  22. $danger: $orange
  23. // Use the new serif family
  24. $family-primary: $family-serif
  25. // 4. Import the rest of Bulma
  26. @import "../bulma"
  27. {% endcapture %}
  28. {% include subnav-overview.html %}
  29. <section class="section">
  30. <div class="container">
  31. <h1 class="title">Customizing with Sass</h1>
  32. <h2 class="subtitle">Create your <strong>own theme</strong> with a simple set of <strong>variables</strong></h2>
  33. <hr>
  34. <div class="content">
  35. <p>If you're familiar with <a href="http://sass-lang.com/">Sass</a> and want to <strong>customize</strong> Bulma with your own colors and variables, just install Bulma via <strong>npm</strong>:</p>
  36. </div>
  37. <article class="media is-large">
  38. <div class="media-left">
  39. <p class="title is-5">1</p>
  40. </div>
  41. <div class="media-content">
  42. <p class="title is-5">
  43. <strong>Download</strong> the source files:
  44. </p>
  45. {% highlight bash %}npm install bulma{% endhighlight %}
  46. <div class="content">or clone the repository: <a href="https://github.com/jgthms/bulma">https://github.com/jgthms/bulma</a></div>
  47. </div>
  48. </article>
  49. <article class="media is-large">
  50. <div class="media-left">
  51. <p class="title is-5">2</p>
  52. </div>
  53. <div class="media-content">
  54. <p class="title is-5">
  55. <strong>Set</strong> your variables
  56. </p>
  57. <p class="subtitle is-6">
  58. Add your own colors, set new fonts, override Bulma styles...
  59. </p>
  60. <div class="highlight-full">
  61. {% highlight sass %}{{ sass }}{% endhighlight %}
  62. </div>
  63. </div>
  64. </article>
  65. <article class="media is-large">
  66. <div class="media-left">
  67. <p class="title is-5">3</p>
  68. </div>
  69. <div class="media-content">
  70. <p class="title is-5">
  71. See the <strong>result</strong>: before and after
  72. </p>
  73. <p class="subtitle is-6">
  74. As <code>$blue</code> has been updated, and since <code>$blue-invert</code> is automatically calculated with the <strong>function</strong> <code>$blue-invert: findColorInvert($blue)</code>, the <code>$blue-invert</code> is now black instead of white</p>
  75. </p>
  76. <figure>
  77. <img width="640" height="640" src="{{site.url}}/images/customize-before.png" alt="Customizing Bulma with Sass">
  78. <img width="640" height="640" src="{{site.url}}/images/customize-after.png" alt="Customizing Bulma with Sass">
  79. </figure>
  80. </div>
  81. </article>
  82. </div>
  83. </section>