customize.html 3.0 KB

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