colors.html 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. ---
  2. title: Colors
  3. layout: documentation
  4. doc-tab: overview
  5. doc-subtab: colors
  6. colors:
  7. - white
  8. - black
  9. - light
  10. - dark
  11. - primary
  12. - link
  13. - info
  14. - success
  15. - warning
  16. - danger
  17. ---
  18. {% include subnav-overview.html %}
  19. <section class="section">
  20. <div class="container">
  21. <h1 class="title">Colors</h1>
  22. <h2 class="subtitle">The <strong>colors</strong> that <strong>style</strong> most Bulma elements and components</h2>
  23. <hr>
  24. <div class="content">
  25. <p>
  26. Most elements and components have color variations thanks to <strong>modifiers</strong> with syntax <code>.is-$color</code>, like <code>is-primary</code> or <code>is-dark</code>.
  27. </p>
  28. <p>
  29. This is thanks to the <code>$colors</code> <strong>Sass map</strong>, through which Bulma cycles to grab all the colors and their inverts.
  30. </p>
  31. </div>
  32. <table class="table">
  33. <thead>
  34. <tr>
  35. <th>Color</th>
  36. <th>Variable</th>
  37. <th>Value</th>
  38. <th>Computed value</th>
  39. <th>Invert value</th>
  40. <th>Computed invert value</th>
  41. </tr>
  42. </thead>
  43. <tbody>
  44. {% for color in page.colors %}
  45. {% assign derivedColor = site.data.colors.derived | where: "id", color | first %}
  46. {% assign initialColor = site.data.colors.initial | where: "id", derivedColor.valueId | first %}
  47. <tr>
  48. <td>
  49. <strong>{{ derivedColor.id | capitalize }}</strong>
  50. </td>
  51. <td>
  52. <code>${{ derivedColor.id }}</code>
  53. </td>
  54. <td>
  55. <code>${{ initialColor.id }}</code>
  56. </td>
  57. <td>
  58. {% include elements/color-square.html value=initialColor.value %}
  59. </td>
  60. {% if derivedColor.invertValue %}
  61. <td>
  62. <code>{{ derivedColor.invertValue }}</code>
  63. </td>
  64. <td>
  65. {% include elements/color-square.html value=derivedColor.invertValue %}
  66. </td>
  67. {% elsif derivedColor.invertId %}
  68. {% assign invertColor = site.data.colors.initial | where: "id", derivedColor.invertId | first %}
  69. <td>
  70. <code>${{ derivedColor.invertId }}</code>
  71. </td>
  72. <td>
  73. {% include elements/color-square.html value=invertColor.value %}
  74. </td>
  75. {% endif %}
  76. </tr>
  77. {% endfor %}
  78. </tbody>
  79. </table>
  80. </div>
  81. </section>