bulma-rails 0.9.4 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +74 -13
  3. data/app/assets/stylesheets/bulma.scss +4 -0
  4. data/app/assets/stylesheets/sass/_index.scss +10 -0
  5. data/app/assets/stylesheets/sass/base/_index.scss +6 -0
  6. data/app/assets/stylesheets/sass/base/animations.scss +15 -0
  7. data/app/assets/stylesheets/sass/base/generic.scss +239 -0
  8. data/app/assets/stylesheets/sass/base/minireset.scss +92 -0
  9. data/app/assets/stylesheets/sass/base/skeleton.scss +114 -0
  10. data/app/assets/stylesheets/sass/components/_index.scss +13 -0
  11. data/app/assets/stylesheets/sass/components/breadcrumb.scss +139 -0
  12. data/app/assets/stylesheets/sass/components/card.scss +162 -0
  13. data/app/assets/stylesheets/sass/components/dropdown.scss +188 -0
  14. data/app/assets/stylesheets/sass/components/menu.scss +165 -0
  15. data/app/assets/stylesheets/sass/components/message.scss +183 -0
  16. data/app/assets/stylesheets/sass/components/modal.scss +164 -0
  17. data/app/assets/stylesheets/sass/components/navbar.scss +799 -0
  18. data/app/assets/stylesheets/sass/components/pagination.scss +379 -0
  19. data/app/assets/stylesheets/sass/components/panel.scss +218 -0
  20. data/app/assets/stylesheets/sass/components/tabs.scss +273 -0
  21. data/app/assets/stylesheets/sass/elements/_index.scss +16 -0
  22. data/app/assets/stylesheets/sass/elements/block.scss +6 -0
  23. data/app/assets/stylesheets/sass/elements/box.scss +59 -0
  24. data/app/assets/stylesheets/sass/elements/button.scss +647 -0
  25. data/app/assets/stylesheets/sass/elements/content.scss +289 -0
  26. data/app/assets/stylesheets/sass/elements/delete.scss +6 -0
  27. data/app/assets/stylesheets/sass/elements/icon.scss +67 -0
  28. data/app/assets/stylesheets/sass/elements/image.scss +62 -0
  29. data/app/assets/stylesheets/sass/elements/loader.scss +15 -0
  30. data/app/assets/stylesheets/sass/elements/notification.scss +105 -0
  31. data/app/assets/stylesheets/sass/elements/progress.scss +115 -0
  32. data/app/assets/stylesheets/sass/elements/table.scss +261 -0
  33. data/app/assets/stylesheets/sass/elements/tag.scss +219 -0
  34. data/app/assets/stylesheets/sass/elements/title.scss +128 -0
  35. data/app/assets/stylesheets/sass/form/_index.scss +9 -0
  36. data/app/assets/stylesheets/sass/form/checkbox-radio.scss +36 -0
  37. data/app/assets/stylesheets/sass/form/file.scss +330 -0
  38. data/app/assets/stylesheets/sass/form/input-textarea.scss +113 -0
  39. data/app/assets/stylesheets/sass/form/select.scss +144 -0
  40. data/app/assets/stylesheets/sass/form/shared.scss +176 -0
  41. data/app/assets/stylesheets/sass/form/tools.scss +352 -0
  42. data/app/assets/stylesheets/sass/grid/_index.scss +5 -0
  43. data/app/assets/stylesheets/sass/grid/columns.scss +961 -0
  44. data/app/assets/stylesheets/sass/grid/grid.scss +209 -0
  45. data/app/assets/stylesheets/sass/helpers/_index.scss +15 -0
  46. data/app/assets/stylesheets/sass/helpers/aspect-ratio.scss +10 -0
  47. data/app/assets/stylesheets/sass/helpers/border.scss +15 -0
  48. data/app/assets/stylesheets/sass/helpers/color.scss +344 -0
  49. data/app/assets/stylesheets/sass/helpers/flexbox.scss +62 -0
  50. data/app/assets/stylesheets/sass/helpers/float.scss +28 -0
  51. data/app/assets/stylesheets/sass/helpers/gap.scss +24 -0
  52. data/app/assets/stylesheets/sass/helpers/other.scss +19 -0
  53. data/app/assets/stylesheets/sass/helpers/overflow.scss +21 -0
  54. data/app/assets/stylesheets/sass/helpers/position.scss +19 -0
  55. data/app/assets/stylesheets/sass/helpers/spacing.scss +64 -0
  56. data/app/assets/stylesheets/sass/helpers/typography.scss +168 -0
  57. data/app/assets/stylesheets/sass/helpers/visibility.scss +221 -0
  58. data/app/assets/stylesheets/sass/layout/_index.scss +9 -0
  59. data/app/assets/stylesheets/sass/layout/container.scss +59 -0
  60. data/app/assets/stylesheets/sass/layout/footer.scss +23 -0
  61. data/app/assets/stylesheets/sass/layout/hero.scss +270 -0
  62. data/app/assets/stylesheets/sass/layout/level.scss +107 -0
  63. data/app/assets/stylesheets/sass/layout/media.scss +106 -0
  64. data/app/assets/stylesheets/sass/layout/section.scss +38 -0
  65. data/app/assets/stylesheets/sass/themes/_index.scss +35 -0
  66. data/app/assets/stylesheets/sass/themes/dark.scss +56 -0
  67. data/app/assets/stylesheets/sass/themes/light.scss +146 -0
  68. data/app/assets/stylesheets/sass/themes/setup.scss +174 -0
  69. data/app/assets/stylesheets/sass/utilities/_index.scss +7 -0
  70. data/app/assets/stylesheets/sass/utilities/controls.scss +85 -0
  71. data/app/assets/stylesheets/sass/utilities/css-variables.scss +426 -0
  72. data/app/assets/stylesheets/sass/utilities/derived-variables.scss +112 -0
  73. data/app/assets/stylesheets/sass/utilities/extends.scss +34 -0
  74. data/app/assets/stylesheets/sass/utilities/functions.scss +258 -0
  75. data/app/assets/stylesheets/sass/utilities/initial-variables.scss +155 -0
  76. data/app/assets/stylesheets/sass/utilities/mixins.scss +460 -0
  77. data/bulma-rails.gemspec +4 -6
  78. metadata +83 -74
  79. data/app/assets/stylesheets/bulma.sass +0 -10
  80. data/app/assets/stylesheets/sass/base/_all.sass +0 -6
  81. data/app/assets/stylesheets/sass/base/animations.sass +0 -5
  82. data/app/assets/stylesheets/sass/base/generic.sass +0 -145
  83. data/app/assets/stylesheets/sass/base/helpers.sass +0 -1
  84. data/app/assets/stylesheets/sass/base/minireset.sass +0 -79
  85. data/app/assets/stylesheets/sass/components/_all.sass +0 -15
  86. data/app/assets/stylesheets/sass/components/breadcrumb.sass +0 -77
  87. data/app/assets/stylesheets/sass/components/card.sass +0 -103
  88. data/app/assets/stylesheets/sass/components/dropdown.sass +0 -83
  89. data/app/assets/stylesheets/sass/components/level.sass +0 -79
  90. data/app/assets/stylesheets/sass/components/media.sass +0 -59
  91. data/app/assets/stylesheets/sass/components/menu.sass +0 -59
  92. data/app/assets/stylesheets/sass/components/message.sass +0 -101
  93. data/app/assets/stylesheets/sass/components/modal.sass +0 -117
  94. data/app/assets/stylesheets/sass/components/navbar.sass +0 -446
  95. data/app/assets/stylesheets/sass/components/pagination.sass +0 -167
  96. data/app/assets/stylesheets/sass/components/panel.sass +0 -121
  97. data/app/assets/stylesheets/sass/components/tabs.sass +0 -176
  98. data/app/assets/stylesheets/sass/elements/_all.sass +0 -16
  99. data/app/assets/stylesheets/sass/elements/box.sass +0 -26
  100. data/app/assets/stylesheets/sass/elements/button.sass +0 -357
  101. data/app/assets/stylesheets/sass/elements/container.sass +0 -29
  102. data/app/assets/stylesheets/sass/elements/content.sass +0 -162
  103. data/app/assets/stylesheets/sass/elements/form.sass +0 -1
  104. data/app/assets/stylesheets/sass/elements/icon.sass +0 -46
  105. data/app/assets/stylesheets/sass/elements/image.sass +0 -73
  106. data/app/assets/stylesheets/sass/elements/notification.sass +0 -52
  107. data/app/assets/stylesheets/sass/elements/other.sass +0 -31
  108. data/app/assets/stylesheets/sass/elements/progress.sass +0 -73
  109. data/app/assets/stylesheets/sass/elements/table.sass +0 -134
  110. data/app/assets/stylesheets/sass/elements/tag.sass +0 -140
  111. data/app/assets/stylesheets/sass/elements/title.sass +0 -70
  112. data/app/assets/stylesheets/sass/form/_all.sass +0 -9
  113. data/app/assets/stylesheets/sass/form/checkbox-radio.sass +0 -22
  114. data/app/assets/stylesheets/sass/form/file.sass +0 -184
  115. data/app/assets/stylesheets/sass/form/input-textarea.sass +0 -66
  116. data/app/assets/stylesheets/sass/form/select.sass +0 -88
  117. data/app/assets/stylesheets/sass/form/shared.sass +0 -60
  118. data/app/assets/stylesheets/sass/form/tools.sass +0 -215
  119. data/app/assets/stylesheets/sass/grid/_all.sass +0 -5
  120. data/app/assets/stylesheets/sass/grid/columns.sass +0 -513
  121. data/app/assets/stylesheets/sass/grid/tiles.sass +0 -36
  122. data/app/assets/stylesheets/sass/helpers/_all.sass +0 -12
  123. data/app/assets/stylesheets/sass/helpers/color.sass +0 -39
  124. data/app/assets/stylesheets/sass/helpers/flexbox.sass +0 -35
  125. data/app/assets/stylesheets/sass/helpers/float.sass +0 -10
  126. data/app/assets/stylesheets/sass/helpers/other.sass +0 -14
  127. data/app/assets/stylesheets/sass/helpers/overflow.sass +0 -2
  128. data/app/assets/stylesheets/sass/helpers/position.sass +0 -7
  129. data/app/assets/stylesheets/sass/helpers/spacing.sass +0 -31
  130. data/app/assets/stylesheets/sass/helpers/typography.sass +0 -103
  131. data/app/assets/stylesheets/sass/helpers/visibility.sass +0 -122
  132. data/app/assets/stylesheets/sass/layout/_all.sass +0 -6
  133. data/app/assets/stylesheets/sass/layout/footer.sass +0 -11
  134. data/app/assets/stylesheets/sass/layout/hero.sass +0 -153
  135. data/app/assets/stylesheets/sass/layout/section.sass +0 -17
  136. data/app/assets/stylesheets/sass/utilities/_all.sass +0 -9
  137. data/app/assets/stylesheets/sass/utilities/animations.sass +0 -1
  138. data/app/assets/stylesheets/sass/utilities/controls.sass +0 -49
  139. data/app/assets/stylesheets/sass/utilities/derived-variables.sass +0 -114
  140. data/app/assets/stylesheets/sass/utilities/extends.sass +0 -25
  141. data/app/assets/stylesheets/sass/utilities/functions.sass +0 -135
  142. data/app/assets/stylesheets/sass/utilities/initial-variables.sass +0 -79
  143. data/app/assets/stylesheets/sass/utilities/mixins.sass +0 -303
@@ -0,0 +1,426 @@
1
+ @use "sass:color";
2
+ @use "sass:list";
3
+ @use "sass:map";
4
+ @use "sass:math";
5
+
6
+ @use "initial-variables" as iv;
7
+ @use "functions" as fn;
8
+
9
+ @function buildVarName($name, $prefix: "", $suffix: "") {
10
+ @return "--#{iv.$cssvars-prefix}#{$prefix}#{$name}#{$suffix}";
11
+ }
12
+
13
+ @function buildHslaString($name, $l, $a: 1) {
14
+ $lightness: getVar($name, "", "-l");
15
+ @if ($l) {
16
+ $lightness: $l;
17
+ }
18
+ @return "hsla(#{getVar($name, '', '-h')}, #{getVar($name, '', '-s')}, #{$lightness}, #{$a})";
19
+ }
20
+
21
+ @function getVar($name, $prefix: "", $suffix: "") {
22
+ $varName: buildVarName($name, $prefix, $suffix);
23
+ @return var(#{$varName});
24
+ }
25
+
26
+ @function getVarWithBackup($name, $backup, $prefix: "", $suffix: "") {
27
+ $varName: buildVarName($name, $prefix, $suffix);
28
+ $backupName: buildVarName($backup, $prefix, $suffix);
29
+ @return var(#{$varName}, var(#{$backupName}));
30
+ }
31
+
32
+ @function getRgbaVar($name, $alpha, $prefix: "", $suffix: "") {
33
+ $varName: buildVarName($name, $prefix, $suffix);
34
+ @return unquote("rgba(var(#{$varName}), #{$alpha})");
35
+ }
36
+
37
+ @mixin register-var($name, $value, $prefix: "", $suffix: "") {
38
+ $varName: buildVarName($name, $prefix, $suffix);
39
+ #{$varName}: #{$value};
40
+ }
41
+
42
+ @mixin register-vars($vars, $prefix: "", $suffix: "") {
43
+ @each $name, $value in $vars {
44
+ @include register-var($name, $value, $prefix, $suffix);
45
+ }
46
+ }
47
+
48
+ @mixin register-rgb($name, $value) {
49
+ @include register-var(
50
+ $name,
51
+ (red($value), green($value), blue($value)),
52
+ "",
53
+ "-rgb"
54
+ );
55
+ }
56
+
57
+ @mixin register-hsl($name, $value) {
58
+ @include register-var($name, round(hue($value)), "", "-h");
59
+ @include register-var($name, round(saturation($value)), "", "-s");
60
+ @include register-var($name, round(lightness($value)), "", "-l");
61
+ }
62
+
63
+ @mixin generate-on-scheme-colors($name, $base, $scheme-main) {
64
+ // Accessibility Contrast System
65
+ $scheme-main-brightness: fn.bulmaColorBrightness($scheme-main);
66
+ $on-scheme-color: $base;
67
+ $fg-lum: fn.bulmaColorLuminance($on-scheme-color);
68
+ $bg-lum: fn.bulmaColorLuminance($scheme-main);
69
+ $ratio: 0;
70
+ $found-decent-color: false;
71
+
72
+ @if ($fg-lum > $bg-lum) {
73
+ @for $i from 0 through 20 {
74
+ $ratio: math.div(($fg-lum + 0.05), ($bg-lum + 0.05));
75
+
76
+ @if $ratio > 5 {
77
+ $found-decent-color: true;
78
+ } @else {
79
+ $on-scheme-color: lighten($on-scheme-color, 5%);
80
+ $fg-lum: fn.bulmaColorLuminance($on-scheme-color);
81
+ }
82
+ }
83
+ } @else {
84
+ @for $i from 0 through 20 {
85
+ $ratio: math.div(($bg-lum + 0.05), ($fg-lum + 0.05));
86
+
87
+ @if $ratio > 5 {
88
+ $found-decent-color: true;
89
+ } @else {
90
+ $on-scheme-color: darken($on-scheme-color, 5%);
91
+ $fg-lum: fn.bulmaColorLuminance($on-scheme-color);
92
+ }
93
+ }
94
+ }
95
+
96
+ $on-scheme-lightness: lightness($on-scheme-color);
97
+ @include register-var($name, $on-scheme-lightness, "", "-on-scheme-l");
98
+ $on-scheme-l: getVar($name, "", "-on-scheme-l");
99
+ @include register-var(
100
+ "#{$name}-on-scheme",
101
+ buildHslaString($name, $on-scheme-l)
102
+ );
103
+ }
104
+
105
+ @mixin v1-generate-on-scheme-colors($name, $base, $scheme-main) {
106
+ // Accessibility Contrast System
107
+ $scheme-main-brightness: fn.bulmaColorBrightness($scheme-main);
108
+ $on-scheme-color: $base;
109
+
110
+ @if ($scheme-main-brightness == "bright") {
111
+ @while (fn.bulmaEnoughContrast($on-scheme-color, #fff) == false) {
112
+ // We're on a light background, so we'll darken the test color step by step.
113
+ $on-scheme-color: darken($on-scheme-color, 5%);
114
+ }
115
+ } @else {
116
+ @while (fn.bulmaEnoughContrast($on-scheme-color, #000) == false) {
117
+ // We're on a dark background, so we'll lighten the test color step by step.
118
+ $on-scheme-color: lighten($on-scheme-color, 5%);
119
+ }
120
+ }
121
+
122
+ $on-scheme-lightness: lightness($on-scheme-color);
123
+ @include register-var($name, $on-scheme-lightness, "", "-on-scheme-l");
124
+ }
125
+
126
+ @mixin register-base-color($name, $base) {
127
+ $hsla: buildHslaString($name, getVar($name, "", "-l"));
128
+ @include register-var($name, $hsla);
129
+ @include register-var($name, $hsla, "", "-base"); // Just for reference
130
+ @include register-rgb($name, $base);
131
+ @include register-hsl($name, $base);
132
+ }
133
+
134
+ @mixin generate-basic-palette($name, $base, $invert: null) {
135
+ @include register-base-color($name, $base);
136
+
137
+ @if $invert {
138
+ @include register-var($name, lightness($invert), "", "-invert-l");
139
+ @include register-var("#{$name}-invert", $invert);
140
+ }
141
+ }
142
+
143
+ @mixin generate-color-palette(
144
+ $name,
145
+ $base,
146
+ $scheme-main-l: 100%,
147
+ $invert: null,
148
+ $light: null,
149
+ $dark: null
150
+ ) {
151
+ $h: round(hue($base)); // Hue
152
+ $s: round(saturation($base)); // Saturation
153
+ $l: round(lightness($base)); // Lightness
154
+ $base-lum: fn.bulmaColorLuminance($base);
155
+ $l-base: round($l % 10); // Get lightness second digit: 53% -> 3%
156
+ $l-0: 0%; // 5% or less
157
+ $l-5: 5%; // More than 5%
158
+ $a: 1; // Alpha
159
+ $base-digits: "00";
160
+
161
+ // Calculate digits like "40" for the scheme-main
162
+ $scheme-l-0: 0%;
163
+ $scheme-l-base: round($scheme-main-l % 10);
164
+ $closest-5: math.round(math.div($scheme-main-l, 5)) * 5;
165
+ $pct-to-int: math.div($closest-5, 100%) * 100;
166
+ $scheme-main-digits: #{$pct-to-int};
167
+
168
+ // === STEP 1 ===
169
+ // Register the base colors
170
+ @include register-base-color($name, $base);
171
+
172
+ // === STEP 2 ===
173
+ // Generating 20 shades of the color
174
+
175
+ // 00: 0%, 1%, 2%
176
+ // 05: 3%, 4%, 5%, 6%, 7%
177
+ // 10: 8%, 9%
178
+
179
+ @if ($l-base < 3%) {
180
+ $l-0: $l-base;
181
+ $l-5: $l-base + 5%;
182
+ } @else if ($l-base < 8%) {
183
+ // $l-0: math.max($l-base - 5%, 0%);
184
+ $l-0: $l-base - 5%;
185
+ $l-5: $l-base;
186
+ } @else {
187
+ // $l-0: math.max($l-base - 10%, 0%);
188
+ $l-0: $l-base - 10%;
189
+ $l-5: $l-base - 5%;
190
+ }
191
+
192
+ $shades: ();
193
+
194
+ @for $i from 0 through 9 {
195
+ // if $l-base = 3%, then we get 3%, 13%, 23%, 33% etc.
196
+ $color-l-0: math.max($l-0 + $i * 10, 0%);
197
+
198
+ // if $l-base = 3%, then we get 8%, 18%, 28%, 38% etc.
199
+ $color-l-5: $l-5 + $i * 10;
200
+
201
+ $shades: map.set($shades, "#{$i}0", $color-l-0);
202
+ $shades: map.set($shades, "#{$i}5", $color-l-5);
203
+
204
+ @include register-var($name, $color-l-0, "", "-#{$i}0-l");
205
+ @include register-var($name, $color-l-5, "", "-#{$i}5-l");
206
+
207
+ @if $color-l-0 == $l {
208
+ $base-digits: "#{$i}0";
209
+ } @else if $color-l-5 == $l {
210
+ $base-digits: "#{$i}5";
211
+ }
212
+ }
213
+
214
+ $l-100: math.min($l-0 + 100%, 100%);
215
+ $shades: map.set($shades, "100", $l-100);
216
+ @include register-var($name, $l-100, "", "-100-l");
217
+
218
+ // === STEP 3 ===
219
+ // Find accessible color combinations
220
+
221
+ $combos: ();
222
+
223
+ @each $digits-bg, $bg-l in $shades {
224
+ $background: hsl($h, $s, $bg-l);
225
+ $bg-lum: fn.bulmaColorLuminance($background);
226
+ $bg-is-light: $bg-lum > 0.55;
227
+ $candidates: ();
228
+ $found: false;
229
+
230
+ // If the background color is the base color
231
+ @if $bg-l == $l {
232
+ $base-digits: $digits-bg;
233
+
234
+ // Even if the base color as a background
235
+ // doesn't have an appropriate foreground,
236
+ // we still add to the list of "valid" contrast combos for now.
237
+ @if $bg-is-light {
238
+ $combos: map.set($combos, $base-digits, "10");
239
+ } @else {
240
+ $combos: map.set($combos, $base-digits, "100");
241
+ }
242
+ }
243
+
244
+ // We capture all contrast ratios for any given background
245
+ // using all foreground options
246
+ $current-best-digits: "00";
247
+ $current-best-ratio: 0;
248
+
249
+ @each $digits-fg, $fg-l in $shades {
250
+ $foreground: hsl($h, $s, $fg-l);
251
+ $ratio: 0;
252
+ $is-light-fg: false;
253
+
254
+ // Source: https://www.w3.org/TR/WCAG20-TECHS/G17.html
255
+ $fg-lum: fn.bulmaColorLuminance($foreground);
256
+
257
+ @if (lightness($foreground) > lightness($background)) {
258
+ $is-light-fg: true;
259
+ $ratio: math.div(($fg-lum + 0.05), ($bg-lum + 0.05));
260
+ } @else {
261
+ $ratio: math.div(($bg-lum + 0.05), ($fg-lum + 0.05));
262
+ }
263
+
264
+ @if $ratio > 7 {
265
+ $candidates: list.append(
266
+ $candidates,
267
+ fn.bulmaStringToNumber($digits-fg)
268
+ );
269
+
270
+ @if ($is-light-fg) {
271
+ @if (not $found) {
272
+ // Store the background/foreground combination
273
+ $combos: map.set($combos, $digits-bg, $digits-fg);
274
+ $current-best-digits: $digits-fg;
275
+ $current-best-ratio: $ratio;
276
+ $found: true;
277
+ }
278
+ } @else {
279
+ $combos: map.set($combos, $digits-bg, $digits-fg);
280
+ $current-best-digits: $digits-fg;
281
+ $current-best-ratio: $ratio;
282
+ }
283
+ }
284
+ }
285
+
286
+ // We haven't found a decent ratio
287
+ @each $digits-fg, $fg-l in $shades {
288
+ @if (map.has-key($combos, $digits-bg) == false) {
289
+ @if ($bg-is-light) {
290
+ // Light background so we set a dark foreground
291
+ $combos: map.set($combos, $digits-bg, "00");
292
+ } @else {
293
+ // Dark background so we set a light foreground
294
+ $combos: map.set($combos, $digits-bg, "100");
295
+ }
296
+ }
297
+ }
298
+ }
299
+
300
+ // The output needs to be:
301
+ // --bulma-primary-invert-l: var(--bulma-primary-100-l);
302
+
303
+ @each $bg, $fg in $combos {
304
+ // Just using this loop to register all 20 digits
305
+ $bg-l: getVar($name, "", "-#{$bg}-l");
306
+ @include register-var("#{$name}-#{$bg}", buildHslaString($name, $bg-l));
307
+
308
+ // Register the lightness
309
+ @include register-var(
310
+ $name,
311
+ getVar($name, "", "-#{$fg}-l"),
312
+ "",
313
+ "-#{$bg}-invert-l"
314
+ );
315
+
316
+ // Resiter the color using that lightness
317
+ $bg-invert-l: getVar($name, "", "-#{$bg}-invert-l");
318
+ @include register-var(
319
+ "#{$name}-#{$bg}-invert",
320
+ buildHslaString($name, $bg-invert-l)
321
+ );
322
+ }
323
+
324
+ // If an invert color is provided by the user
325
+ @if $invert {
326
+ @include register-var($name, lightness($invert), "", "-invert-l");
327
+ @include register-var("#{$name}-invert", $invert);
328
+ } @else {
329
+ $base-invert-l-digits: map.get($combos, $base-digits);
330
+ @include register-var(
331
+ $name,
332
+ getVar($name, "", "-#{$base-invert-l-digits}-l"),
333
+ "",
334
+ "-invert-l"
335
+ );
336
+
337
+ $base-invert-l: getVar($name, "", "-invert-l");
338
+ @include register-var(
339
+ "#{$name}-invert",
340
+ buildHslaString($name, $base-invert-l)
341
+ );
342
+ }
343
+
344
+ // Good color on light background (90% lightness)
345
+ @if $light and $dark {
346
+ @include register-var($name, lightness($light), "", "-light-l");
347
+ @include register-var($name, lightness($light), "", "-dark-invert-l");
348
+ @include register-var("#{$name}-light", $light);
349
+ @include register-var("#{$name}-dark-invert", $light);
350
+
351
+ @include register-var($name, lightness($dark), "", "-dark-l");
352
+ @include register-var($name, lightness($dark), "", "-light-invert-l");
353
+ @include register-var("#{$name}-dark", $dark);
354
+ @include register-var("#{$name}-light-invert", $dark);
355
+ } @else {
356
+ @include register-var($name, getVar($name, "", "-90-l"), "", "-light-l");
357
+
358
+ $light-l: getVar($name, "", "-light-l");
359
+ @include register-var("#{$name}-light", buildHslaString($name, $light-l));
360
+
361
+ $light-invert-l-digits: map.get($combos, "90");
362
+ @include register-var(
363
+ $name,
364
+ getVar($name, "", "-#{$light-invert-l-digits}-l"),
365
+ "",
366
+ "-light-invert-l"
367
+ );
368
+
369
+ $light-invert-l: getVar($name, "", "-light-invert-l");
370
+ @include register-var(
371
+ "#{$name}-light-invert",
372
+ buildHslaString($name, $light-invert-l)
373
+ );
374
+
375
+ // Good color on dark background (10% lightness)
376
+ @include register-var($name, getVar($name, "", "-10-l"), "", "-dark-l");
377
+
378
+ $dark-l: getVar($name, "", "-dark-l");
379
+ @include register-var("#{$name}-dark", buildHslaString($name, $dark-l));
380
+
381
+ $dark-invert-l-digits: map.get($combos, "10");
382
+ @include register-var(
383
+ $name,
384
+ getVar($name, "", "-#{$dark-invert-l-digits}-l"),
385
+ "",
386
+ "-dark-invert-l"
387
+ );
388
+
389
+ $dark-invert-l: getVar($name, "", "-dark-invert-l");
390
+ @include register-var(
391
+ "#{$name}-dark-invert",
392
+ buildHslaString($name, $dark-invert-l)
393
+ );
394
+
395
+ // Soft and Bold colors
396
+ $soft-l: getVar("soft-l");
397
+ $soft-invert-l: getVar("soft-invert-l");
398
+ $bold-l: getVar("bold-l");
399
+ $bold-invert-l: getVar("bold-invert-l");
400
+ @include register-var("#{$name}-soft", buildHslaString($name, $soft-l));
401
+ @include register-var("#{$name}-bold", buildHslaString($name, $bold-l));
402
+ @include register-var(
403
+ "#{$name}-soft-invert",
404
+ buildHslaString($name, $soft-invert-l)
405
+ );
406
+ @include register-var(
407
+ "#{$name}-bold-invert",
408
+ buildHslaString($name, $bold-invert-l)
409
+ );
410
+ }
411
+ }
412
+
413
+ @mixin bulma-theme($name) {
414
+ [data-#{iv.$class-prefix}theme="#{$name}"],
415
+ .#{iv.$class-prefix}theme-#{$name} {
416
+ @content;
417
+ }
418
+ }
419
+
420
+ @mixin system-theme($name) {
421
+ @media (prefers-color-scheme: #{$name}) {
422
+ :root {
423
+ @content;
424
+ }
425
+ }
426
+ }
@@ -0,0 +1,112 @@
1
+ @use "initial-variables" as iv;
2
+ @use "functions" as fn;
3
+
4
+ // Scheme colors
5
+
6
+ $scheme-main: iv.$white !default;
7
+ $scheme-main-bis: iv.$white-bis !default;
8
+ $scheme-main-ter: iv.$white-ter !default;
9
+ $scheme-invert: iv.$black !default;
10
+ $scheme-invert-bis: iv.$black-bis !default;
11
+ $scheme-invert-ter: iv.$black-ter !default;
12
+
13
+ // Text colors
14
+
15
+ $text: iv.$grey-dark !default;
16
+ $text-invert: fn.bulmaFindColorInvert($text) !default;
17
+ $text-weak: iv.$grey !default;
18
+ $text-strong: iv.$grey-darker !default;
19
+
20
+ // Status colors
21
+
22
+ $primary: iv.$turquoise !default;
23
+ $info: iv.$cyan !default;
24
+ $success: iv.$green !default;
25
+ $warning: iv.$yellow !default;
26
+ $danger: iv.$red !default;
27
+ $light: iv.$white-ter !default;
28
+ $dark: iv.$grey-darker !default;
29
+
30
+ // Link colors
31
+
32
+ $link: iv.$blue !default;
33
+
34
+ // Decorative colors
35
+
36
+ $background: iv.$white-ter !default;
37
+ $border: iv.$grey-lighter !default;
38
+ $border-weak: iv.$grey-lightest !default;
39
+
40
+ // Code colors
41
+
42
+ $code: iv.$red !default;
43
+ $code-background: $background !default;
44
+
45
+ $pre: $text !default;
46
+ $pre-background: $background !default;
47
+
48
+ // Typography
49
+
50
+ $family-primary: iv.$family-sans-serif !default;
51
+ $family-secondary: iv.$family-sans-serif !default;
52
+ $family-code: iv.$family-monospace !default;
53
+
54
+ $size-small: iv.$size-7 !default;
55
+ $size-normal: iv.$size-6 !default;
56
+ $size-medium: iv.$size-5 !default;
57
+ $size-large: iv.$size-4 !default;
58
+
59
+ // Effects
60
+
61
+ $shadow-color: iv.$black !default;
62
+
63
+ // Lists and maps
64
+ $custom-colors: null !default;
65
+ $custom-shades: null !default;
66
+
67
+ $colors: fn.mergeColorMaps(
68
+ (
69
+ "white": (
70
+ iv.$white,
71
+ iv.$black,
72
+ ),
73
+ "black": (
74
+ iv.$black,
75
+ iv.$white,
76
+ ),
77
+ "light": (
78
+ $light,
79
+ $dark,
80
+ ),
81
+ "dark": (
82
+ $dark,
83
+ $light,
84
+ ),
85
+ "text": $text,
86
+ "primary": $primary,
87
+ "link": $link,
88
+ "info": $info,
89
+ "success": $success,
90
+ "warning": $warning,
91
+ "danger": $danger,
92
+ ),
93
+ $custom-colors
94
+ ) !default;
95
+
96
+ $shades: fn.mergeColorMaps(
97
+ (
98
+ "black-bis": iv.$black-bis,
99
+ "black-ter": iv.$black-ter,
100
+ "grey-darker": iv.$grey-darker,
101
+ "grey-dark": iv.$grey-dark,
102
+ "grey": iv.$grey,
103
+ "grey-light": iv.$grey-light,
104
+ "grey-lighter": iv.$grey-lighter,
105
+ "white-ter": iv.$white-ter,
106
+ "white-bis": iv.$white-bis,
107
+ ),
108
+ $custom-shades
109
+ ) !default;
110
+
111
+ $sizes: iv.$size-1 iv.$size-2 iv.$size-3 iv.$size-4 iv.$size-5 iv.$size-6
112
+ iv.$size-7 !default;
@@ -0,0 +1,34 @@
1
+ @use "controls";
2
+ @use "mixins";
3
+
4
+ %arrow {
5
+ @include mixins.arrow;
6
+ }
7
+
8
+ %block {
9
+ @include mixins.block;
10
+ }
11
+
12
+ %control {
13
+ @include controls.control;
14
+ }
15
+
16
+ %delete {
17
+ @include mixins.delete;
18
+ }
19
+
20
+ %loader {
21
+ @include mixins.loader;
22
+ }
23
+
24
+ %overlay {
25
+ @include mixins.overlay;
26
+ }
27
+
28
+ %reset {
29
+ @include mixins.reset;
30
+ }
31
+
32
+ %unselectable {
33
+ @include mixins.unselectable;
34
+ }