colors.html 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. ---
  2. title: Colors
  3. layout: documentation
  4. doc-tab: overview
  5. doc-subtab: colors
  6. breadcrumb:
  7. - home
  8. - documentation
  9. - overview
  10. - overview-colors
  11. colors:
  12. - white
  13. - black
  14. - light
  15. - dark
  16. - primary
  17. - link
  18. - info
  19. - success
  20. - warning
  21. - danger
  22. shades:
  23. - black-bis
  24. - black-ter
  25. - grey-darker
  26. - grey-dark
  27. - grey-light
  28. - grey-lighter
  29. - white-ter
  30. - white-bis
  31. ---
  32. <div class="content">
  33. <p>
  34. 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>.
  35. </p>
  36. <p>
  37. This is thanks to the <code>$colors</code> <strong>Sass map</strong>, through which Bulma cycles to grab all the colors and their inverts.
  38. </p>
  39. </div>
  40. <table class="table">
  41. <thead>
  42. <tr>
  43. <th>Color</th>
  44. <th>Variable</th>
  45. <th>Value</th>
  46. <th>Computed value</th>
  47. <th>Invert value</th>
  48. <th>Computed invert value</th>
  49. </tr>
  50. </thead>
  51. <tbody>
  52. {% for color in page.colors %}
  53. {% assign derivedColor = site.data.colors.derived | where: "id", color | first %}
  54. {% assign initialColor = site.data.colors.initial | where: "id", derivedColor.valueId | first %}
  55. <tr>
  56. <td>
  57. <strong>{{ derivedColor.id | capitalize }}</strong>
  58. </td>
  59. <td>
  60. <code>${{ derivedColor.id }}</code>
  61. </td>
  62. <td>
  63. <code>${{ initialColor.id }}</code>
  64. </td>
  65. <td>
  66. {% include elements/color-square.html value=initialColor.value %}
  67. </td>
  68. {% if derivedColor.invertValue %}
  69. <td>
  70. <code>{{ derivedColor.invertValue }}</code>
  71. </td>
  72. <td>
  73. {% include elements/color-square.html value=derivedColor.invertValue %}
  74. </td>
  75. {% elsif derivedColor.invertId %}
  76. {% assign invertColor = site.data.colors.initial | where: "id", derivedColor.invertId | first %}
  77. <td>
  78. <code>${{ derivedColor.invertId }}</code>
  79. </td>
  80. <td>
  81. {% include elements/color-square.html value=invertColor.value %}
  82. </td>
  83. {% endif %}
  84. </tr>
  85. {% endfor %}
  86. </tbody>
  87. </table>
  88. <div class="content">
  89. <p>
  90. Bulma also provides a <code>$shades</code> <strong>Sass map</strong>, that only contains shades of grey between black and white.
  91. </p>
  92. </div>
  93. <table class="table">
  94. <thead>
  95. <tr>
  96. <th>Color</th>
  97. <th>Variable</th>
  98. <th>Value</th>
  99. </tr>
  100. </thead>
  101. <tbody>
  102. {% for shade in page.shades %}
  103. {% assign initial_shade = site.data.colors.initial | where: "id", shade | first %}
  104. <tr>
  105. <td>
  106. <strong>{{ initial_shade.name | capitalize }}</strong>
  107. </td>
  108. <td>
  109. <code>${{ initial_shade.id }}</code>
  110. </td>
  111. <td>
  112. {% include elements/color-square.html value=initial_shade.value %}
  113. </td>
  114. </tr>
  115. {% endfor %}
  116. </tbody>
  117. </table>