@filip.mazev/blocks 1.4.10 → 1.4.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +15 -3
  2. package/core/styles/_index.scss +7 -0
  3. package/core/styles/_overlay.scss +4 -0
  4. package/core/styles/_palettes.scss +42 -0
  5. package/core/styles/_theme-engine.scss +180 -149
  6. package/core/styles/themes/_azure-coral-theme.scss +4 -0
  7. package/core/styles/themes/_blue-theme.scss +4 -3
  8. package/core/styles/themes/_cyberpunk-theme.scss +3 -2
  9. package/core/styles/themes/_graphite-sky-blue-theme.scss +19 -0
  10. package/core/styles/themes/_green-theme.scss +4 -3
  11. package/core/styles/themes/_high-contrast-theme.scss +25 -6
  12. package/core/styles/themes/_lime-violet-theme.scss +4 -0
  13. package/core/styles/themes/_orange-theme.scss +4 -3
  14. package/core/styles/themes/_purple-theme.scss +4 -3
  15. package/core/styles/themes/_red-theme.scss +4 -3
  16. package/core/styles/themes/_scarlet-cyan-theme.scss +4 -0
  17. package/core/styles/themes/_tangerine-indigo-theme.scss +4 -0
  18. package/core/styles/themes/_violet-teal-theme.scss +4 -0
  19. package/core/styles/themes/_white-theme.scss +4 -27
  20. package/fesm2022/filip.mazev-blocks-core.mjs +139 -35
  21. package/fesm2022/filip.mazev-blocks-core.mjs.map +1 -1
  22. package/fesm2022/filip.mazev-blocks-effects-runtime.mjs +1 -1
  23. package/fesm2022/filip.mazev-blocks-effects-runtime.mjs.map +1 -1
  24. package/fesm2022/filip.mazev-blocks-forms.mjs +16 -34
  25. package/fesm2022/filip.mazev-blocks-forms.mjs.map +1 -1
  26. package/fesm2022/filip.mazev-blocks-primitives.mjs +496 -41
  27. package/fesm2022/filip.mazev-blocks-primitives.mjs.map +1 -1
  28. package/fesm2022/filip.mazev-blocks.mjs +1 -1
  29. package/fesm2022/filip.mazev-blocks.mjs.map +1 -1
  30. package/package.json +1 -1
  31. package/schematics/ng-add/index.d.ts +10 -1
  32. package/schematics/ng-add/index.js +15 -4
  33. package/schematics/ng-add/schema.json +23 -17
  34. package/types/filip.mazev-blocks-core.d.ts +20 -7
  35. package/types/filip.mazev-blocks-forms.d.ts +2 -3
  36. package/types/filip.mazev-blocks-primitives.d.ts +118 -4
  37. package/types/filip.mazev-blocks.d.ts +1 -1
package/README.md CHANGED
@@ -18,7 +18,7 @@ ng add @filip.mazev/blocks
18
18
 
19
19
  When you run the command above, the Angular CLI will execute our custom schematic to handle the boilerplate for you:
20
20
 
21
- * Theme selection: White is the CLI default; Blue, Purple, Orange, Red, Green and Cyberpunk are also available. Use `--theme=blue` for the Blue palette based on `#217eff`.
21
+ * Palette selection: Graphite / Sky Blue is the CLI default. Azure / Coral, Violet / Teal, Tangerine / Indigo, Scarlet / Cyan, Lime / Violet, and Cyberpunk are also available. Use `--theme=azure-coral` to select Azure / Coral.
22
22
  * Dependency Management: Automatically adds the latest versions of the Blocks ecosystem to your package.json and runs npm install.
23
23
  * SCSS Injection: Intelligently locates your project's global stylesheet (styles.scss or styles.sass) and injects the required @use statements, mixins, and both light/dark mode CSS variables based on your theme selection.
24
24
 
@@ -37,16 +37,28 @@ Then, manually configure your styles.scss:
37
37
 
38
38
  @layer base {
39
39
  :root {
40
- @include bx-theme($white-light-theme);
40
+ @include bx-theme($graphite-sky-blue-light-theme);
41
41
  }
42
42
 
43
43
  [data-theme='dark'] {
44
- @include bx-theme($white-dark-theme);
44
+ @include bx-theme($graphite-sky-blue-dark-theme);
45
45
  }
46
46
  }
47
47
  ```
48
48
 
49
49
 
50
+ ## Palettes
51
+
52
+ Use paired palette IDs consistently in the CLI and `ThemingService.setPalette()`. For example:
53
+
54
+ ```sh
55
+ ng add @filip.mazev/blocks --theme=azure-coral
56
+ ```
57
+
58
+ The Sass exports use the same names: `$azure-coral-light-theme` and `$azure-coral-dark-theme`. Graphite / Sky Blue is the installer default; the playground starts with Graphite / Sky Blue. Previous IDs and Sass names remain aliases.
59
+
60
+ Buttons and tabs accept `color="accent"` for the second tone. Icons and custom components can use semantic tokens such as `text-accent`, `accent-subtle`, `on-accent`, and `border-accent`. Canvas backgrounds stay neutral; status roles keep their meaning. See [the palette reference](../../documentation/appearance/README.md#palettes) for all seven pairs.
61
+
50
62
  ## Appearance
51
63
 
52
64
  Version 1.4.0 integrates glass throughout Blocks using its existing semantic theme. Configure it application-wide through `ThemingService.setAppearance({ glassiness: 0.5 })`; use `resetAppearance()` for defaults. Existing controls receive their material automatically, including menus, dialogs and notifications.
@@ -4,6 +4,12 @@
4
4
  @forward 'palettes';
5
5
  @forward 'theme-engine';
6
6
  @forward 'a11y';
7
+ @forward 'themes/graphite-sky-blue-theme';
8
+ @forward 'themes/azure-coral-theme';
9
+ @forward 'themes/violet-teal-theme';
10
+ @forward 'themes/tangerine-indigo-theme';
11
+ @forward 'themes/scarlet-cyan-theme';
12
+ @forward 'themes/lime-violet-theme';
7
13
  @forward 'themes/white-theme';
8
14
  @forward 'themes/blue-theme';
9
15
  @forward 'themes/purple-theme';
@@ -14,3 +20,4 @@
14
20
  @forward 'themes/high-contrast-theme';
15
21
  @forward 'slider';
16
22
  @forward 'validation';
23
+ @forward 'overlay';
@@ -0,0 +1,4 @@
1
+ .cdk-overlay-connected-position-bounding-box.bx-overlay-anchored {
2
+ position: fixed !important;
3
+ inset: var(--bx-overlay-anchor-top) auto auto var(--bx-overlay-anchor-left) !important;
4
+ }
@@ -1,4 +1,22 @@
1
1
  @use 'sass:map';
2
+ @use 'sass:color';
3
+
4
+ /* stylelint-disable-next-line scss/at-function-pattern -- The underscore keeps this Sass helper private. */
5
+ @function _tonal-palette($anchor) {
6
+ @return (
7
+ 50: color.mix(#ffffff, $anchor, 96%),
8
+ 100: color.mix(#ffffff, $anchor, 88%),
9
+ 200: color.mix(#ffffff, $anchor, 72%),
10
+ 300: color.mix(#ffffff, $anchor, 52%),
11
+ 400: color.mix(#ffffff, $anchor, 25%),
12
+ 500: $anchor,
13
+ 600: color.mix(#000000, $anchor, 15%),
14
+ 700: color.mix(#000000, $anchor, 32%),
15
+ 800: color.mix(#000000, $anchor, 52%),
16
+ 900: color.mix(#000000, $anchor, 76%),
17
+ 1000: color.mix(#000000, $anchor, 92%)
18
+ );
19
+ }
2
20
 
3
21
  $blue-palette: (
4
22
  50: #eff6ff,
@@ -162,7 +180,31 @@ $hc-yellow: #e4d500;
162
180
  $hc-cyan: #00f3f3;
163
181
  $hc-red: #ff0000;
164
182
  $hc-green: #00ff00;
183
+ $graphite-palette: _tonal-palette(#525252) !default;
184
+ $sky-blue-palette: _tonal-palette(#38bdf8) !default;
185
+ $azure-palette: $blue-palette !default;
186
+ $coral-palette: _tonal-palette(#f87763) !default;
187
+ $violet-palette: $purple-palette !default;
188
+ $teal-palette: _tonal-palette(#0d9488) !default;
189
+ $tangerine-palette: $orange-palette !default;
190
+ $indigo-palette: _tonal-palette(#4f78f5) !default;
191
+ $scarlet-palette: $red-palette !default;
192
+ $cyan-palette: _tonal-palette(#0891b2) !default;
193
+ $lime-palette: _tonal-palette(#c4f53d) !default;
194
+ $cool-violet-palette: _tonal-palette(#6842a6) !default;
165
195
  $all-palettes: (
196
+ 'graphite': $graphite-palette,
197
+ 'sky-blue': $sky-blue-palette,
198
+ 'azure': $azure-palette,
199
+ 'coral': $coral-palette,
200
+ 'violet': $violet-palette,
201
+ 'teal': $teal-palette,
202
+ 'tangerine': $tangerine-palette,
203
+ 'indigo': $indigo-palette,
204
+ 'scarlet': $scarlet-palette,
205
+ 'cyan': $cyan-palette,
206
+ 'lime': $lime-palette,
207
+ 'cool-violet': $cool-violet-palette,
166
208
  'blue': $blue-palette,
167
209
  'orange': $orange-palette,
168
210
  'purple': $purple-palette,
@@ -1,6 +1,8 @@
1
1
  @use 'sass:map';
2
2
  @use 'sass:list';
3
3
  @use 'sass:string';
4
+ @use 'sass:color';
5
+ @use 'sass:math';
4
6
  @use 'palettes' as *;
5
7
 
6
8
  $required-theme-keys: (
@@ -18,6 +20,17 @@ $required-theme-keys: (
18
20
  'primary-active',
19
21
  'primary-subtle',
20
22
  'on-primary',
23
+ 'on-primary-hover',
24
+ 'on-primary-active',
25
+ 'accent',
26
+ 'accent-hover',
27
+ 'accent-active',
28
+ 'accent-subtle',
29
+ 'on-accent',
30
+ 'on-accent-hover',
31
+ 'on-accent-active',
32
+ 'text-accent',
33
+ 'border-accent',
21
34
  'text-heading',
22
35
  'text-primary',
23
36
  'text-secondary',
@@ -58,7 +71,8 @@ $required-theme-keys: (
58
71
  'scroll-bg',
59
72
  'scroll-thumb',
60
73
  'scroll-thumb-hover',
61
- 'meta-brand-palette'
74
+ 'meta-brand-palette',
75
+ 'meta-accent-palette'
62
76
  );
63
77
 
64
78
  @function validate-theme($theme, $theme-name) {
@@ -69,7 +83,7 @@ $required-theme-keys: (
69
83
  }
70
84
 
71
85
  @each $key, $value in $theme {
72
- @if string.index($key, 'meta-') != 1 {
86
+ @if string.index($key, 'meta-') !=1 {
73
87
  @if not list.index($required-theme-keys, $key) {
74
88
  @error "Strict Theme Error: '#{$theme-name}' contains an invalid key '#{$key}'. Remove or rename it.";
75
89
  }
@@ -79,188 +93,205 @@ $required-theme-keys: (
79
93
  @return $theme;
80
94
  }
81
95
 
82
- @function make-light-theme($surface-brand, $accent: $surface-brand, $overrides: ()) {
83
- $base: (
84
- 'bg-canvas': #ffffff,
85
- 'bg-surface': #ffffff,
86
- 'bg-surface-alt': get-color-from-palette($surface-brand, 50),
87
- 'bg-element': get-color-from-palette('neutral', 100),
88
- 'bg-element-hover': get-color-from-palette($surface-brand, 200),
89
- 'bg-element-active': get-color-from-palette($surface-brand, 300),
90
- 'bg-neutral': get-color-from-palette('neutral', 100),
91
- 'bg-neutral-hover': get-color-from-palette('neutral', 50),
92
- 'bg-neutral-active': get-color-from-palette('neutral', 200),
93
- 'primary': get-color-from-palette($accent, 500),
94
- 'primary-hover': get-color-from-palette($accent, 600),
95
- 'primary-active': get-color-from-palette($accent, 700),
96
- 'primary-subtle': rgba(get-color-from-palette($accent, 300), 0.6),
97
- 'on-primary': get-color-from-palette('neutral', 100),
98
- 'text-heading': get-color-from-palette('neutral', 900),
99
- 'text-primary': get-color-from-palette('neutral', 700),
100
- 'text-secondary': get-color-from-palette('neutral', 500),
101
- 'text-brand': get-color-from-palette($accent, 700),
102
- 'text-inverse': get-color-from-palette('neutral', 100),
103
- 'text-info': get-color-from-palette('information', 700),
104
- 'text-warn': get-color-from-palette('warn', 700),
105
- 'text-success': get-color-from-palette('success', 700),
106
- 'text-danger': get-color-from-palette('danger', 700),
107
- 'border-subtle': get-color-from-palette('neutral', 200),
108
- 'border-default': get-color-from-palette('neutral', 300),
109
- 'border-strong': get-color-from-palette('neutral', 400),
110
- 'border-brand': get-color-from-palette($accent, 400),
111
- 'border-info': get-color-from-palette('information', 400),
112
- 'border-success': get-color-from-palette('success', 400),
113
- 'border-warn': get-color-from-palette('warn', 400),
114
- 'border-danger': get-color-from-palette('danger', 400),
115
- 'bg-info': get-color-from-palette('information', 100),
116
- 'bg-info-hover': get-color-from-palette('information', 200),
117
- 'bg-info-active': get-color-from-palette('information', 300),
118
- 'bg-info-disabled': get-color-from-palette('information', 50),
119
- 'bg-info-subtle': rgb(get-color-from-palette('information', 50), 0.95),
120
- 'bg-success': get-color-from-palette('success', 100),
121
- 'bg-success-hover': get-color-from-palette('success', 200),
122
- 'bg-success-active': get-color-from-palette('success', 300),
123
- 'bg-success-disabled': get-color-from-palette('success', 50),
124
- 'bg-success-subtle': rgb(get-color-from-palette('success', 50), 0.95),
125
- 'bg-warn': get-color-from-palette('warn', 100),
126
- 'bg-warn-hover': get-color-from-palette('warn', 200),
127
- 'bg-warn-active': get-color-from-palette('warn', 300),
128
- 'bg-warn-disabled': get-color-from-palette('warn', 50),
129
- 'bg-warn-subtle': rgb(get-color-from-palette('warn', 50), 0.95),
130
- 'bg-danger': get-color-from-palette('danger', 100),
131
- 'bg-danger-hover': get-color-from-palette('danger', 200),
132
- 'bg-danger-active': get-color-from-palette('danger', 300),
133
- 'bg-danger-disabled': get-color-from-palette('danger', 50),
134
- 'bg-danger-subtle': rgb(get-color-from-palette('danger', 50), 0.95),
135
- 'scroll-bg': get-color-from-palette($surface-brand, 100),
136
- 'scroll-thumb': linear-gradient(
137
- 278deg,
138
- get-color-from-palette($accent, 300) -10.44%,
139
- get-color-from-palette($accent, 400) 100%
140
- ),
141
- 'scroll-thumb-hover': linear-gradient(
142
- 278deg,
143
- get-color-from-palette($accent, 400) -10.44%,
144
- get-color-from-palette($accent, 700) 100%
145
- ),
146
- 'meta-brand-palette': $accent,
96
+ /* stylelint-disable scss/at-function-pattern -- Underscores keep the Sass helpers private. */
97
+ @function _luminance($value) {
98
+ $result: 0;
99
+ $weights: (
100
+ 'red': 0.2126,
101
+ 'green': 0.7152,
102
+ 'blue': 0.0722,
147
103
  );
148
- $merged-theme: map.merge($base, $overrides);
149
104
 
150
- @return validate-theme($merged-theme, '#{$surface-brand}-#{$accent}-light');
105
+ @each $channel, $weight in $weights {
106
+ $part: math.div(color.channel($value, $channel, $space: rgb), 255);
107
+
108
+ /* stylelint-disable-next-line number-max-precision -- Preserve the exact sRGB linearization threshold. */
109
+ @if $part <=0.04045 {
110
+ $part: math.div($part, 12.92);
111
+ }
112
+
113
+ @else {
114
+ $part: math.pow(math.div($part + 0.055, 1.055), 2.4);
115
+ }
116
+
117
+ $result: $result + $part * $weight;
118
+ }
119
+
120
+ @return $result;
121
+ }
122
+
123
+ @function _contrast($first, $second) {
124
+ $a: _luminance($first);
125
+ $b: _luminance($second);
126
+
127
+ @return math.div(math.max($a, $b) + 0.05, math.min($a, $b) + 0.05);
128
+ }
129
+
130
+ @function _on-color($background) {
131
+ $dark: #0b0b0b;
132
+
133
+ @if _contrast($dark, $background) < 4.5 {
134
+ $dark: #000000;
135
+ }
136
+
137
+ @if _contrast($dark, $background)>=_contrast(#ffffff, $background) {
138
+ @return $dark;
139
+ }
140
+
141
+ @return #ffffff;
151
142
  }
152
143
 
153
- @function make-dark-theme($surface-brand, $accent: $surface-brand, $overrides: ()) {
144
+ @function _mode($dark, $light-value, $dark-value) {
145
+ @if $dark {
146
+ @return $dark-value;
147
+ }
148
+
149
+ @return $light-value;
150
+ }
151
+
152
+ @function _color-roles($palette, $role, $dark) {
153
+ $base: get-color-from-palette($palette, _mode($dark, 500, 300));
154
+ $hover: get-color-from-palette($palette, _mode($dark, 600, 200));
155
+ $active: get-color-from-palette($palette, _mode($dark, 700, 100));
156
+ $subtle: get-color-from-palette($palette, _mode($dark, 100, 900));
157
+ $text: get-color-from-palette($palette, _mode($dark, 800, 200));
158
+
159
+ @if _contrast($text, $subtle) < 4.5 {
160
+ $text: _on-color($subtle);
161
+ }
162
+
163
+ $text-key: 'text-accent';
164
+ $border-key: 'border-accent';
165
+
166
+ @if $role =='primary' {
167
+ $text-key: 'text-brand';
168
+ $border-key: 'border-brand';
169
+ }
170
+
171
+ @return ($role: $base,
172
+ '#{$role}-hover': $hover,
173
+ '#{$role}-active': $active,
174
+ '#{$role}-subtle': $subtle,
175
+ 'on-#{$role}': _on-color($base),
176
+ 'on-#{$role}-hover': _on-color($hover),
177
+ 'on-#{$role}-active': _on-color($active),
178
+ $text-key: $text,
179
+ $border-key: get-color-from-palette($palette, _mode($dark, 800, 300)));
180
+ }
181
+
182
+ @function _make-theme($brand, $accent, $dark, $overrides) {
154
183
  $base: (
155
- 'bg-canvas': #000000,
156
- 'bg-surface': get-color-from-palette('neutral', 1000),
157
- 'bg-surface-alt': get-color-from-palette('neutral', 900),
158
- 'bg-element': get-color-from-palette('neutral', 800),
159
- 'bg-element-hover': get-color-from-palette($surface-brand, 700),
160
- 'bg-element-active': get-color-from-palette($surface-brand, 800),
161
- 'bg-neutral': get-color-from-palette('neutral', 900),
162
- 'bg-neutral-hover': get-color-from-palette('neutral', 800),
163
- 'bg-neutral-active': get-color-from-palette('neutral', 600),
164
- 'primary': get-color-from-palette($accent, 500),
165
- 'primary-hover': get-color-from-palette($accent, 400),
166
- 'primary-active': get-color-from-palette($accent, 300),
167
- 'primary-subtle': rgba(get-color-from-palette($accent, 700), 0.6),
168
- 'on-primary': #ffffff,
169
-
170
- 'text-heading': #ffffff,
171
- 'text-primary': get-color-from-palette('neutral', 200),
172
- 'text-secondary': get-color-from-palette('neutral', 400),
173
- 'text-brand': get-color-from-palette($accent, 300),
174
- 'text-inverse': get-color-from-palette('neutral', 900),
175
- 'text-info': get-color-from-palette('information', 400),
176
- 'text-success': get-color-from-palette('success', 400),
177
- 'text-warn': get-color-from-palette('warn', 400),
178
- 'text-danger': get-color-from-palette('danger', 400),
179
- 'border-subtle': get-color-from-palette('neutral', 900),
180
- 'border-default': get-color-from-palette('neutral', 800),
181
- 'border-strong': get-color-from-palette('neutral', 700),
182
- 'border-brand': get-color-from-palette($accent, 600),
183
- 'border-info': get-color-from-palette('information', 400),
184
- 'border-success': get-color-from-palette('success', 400),
185
- 'border-warn': get-color-from-palette('warn', 400),
186
- 'border-danger': get-color-from-palette('danger', 400),
187
- 'bg-info': get-color-from-palette('information', 900),
188
- 'bg-info-hover': get-color-from-palette('information', 800),
189
- 'bg-info-active': get-color-from-palette('information', 700),
190
- 'bg-info-disabled': get-color-from-palette('information', 1000),
191
- 'bg-info-subtle': rgb(get-color-from-palette('information', 1000), 0.95),
192
- 'bg-success': get-color-from-palette('success', 900),
193
- 'bg-success-hover': get-color-from-palette('success', 800),
194
- 'bg-success-active': get-color-from-palette('success', 700),
195
- 'bg-success-disabled': get-color-from-palette('success', 1000),
196
- 'bg-success-subtle': rgb(get-color-from-palette('success', 1000), 0.95),
197
- 'bg-warn': get-color-from-palette('warn', 900),
198
- 'bg-warn-hover': get-color-from-palette('warn', 800),
199
- 'bg-warn-active': get-color-from-palette('warn', 700),
200
- 'bg-warn-disabled': get-color-from-palette('warn', 1000),
201
- 'bg-warn-subtle': rgb(get-color-from-palette('warn', 1000), 0.95),
202
- 'bg-danger': get-color-from-palette('danger', 900),
203
- 'bg-danger-hover': get-color-from-palette('danger', 800),
204
- 'bg-danger-active': get-color-from-palette('danger', 700),
205
- 'bg-danger-disabled': get-color-from-palette('danger', 1000),
206
- 'bg-danger-subtle': rgb(get-color-from-palette('danger', 1000), 0.95),
207
- 'scroll-bg': get-color-from-palette($surface-brand, 900),
208
- 'scroll-thumb': linear-gradient(
209
- 278deg,
210
- get-color-from-palette($accent, 700) -10.44%,
211
- get-color-from-palette($accent, 500) 100%
212
- ),
213
- 'scroll-thumb-hover': linear-gradient(
214
- 278deg,
215
- get-color-from-palette($accent, 500) -10.44%,
216
- get-color-from-palette($accent, 400) 100%
217
- ),
218
- 'meta-brand-palette': $accent,
184
+ 'bg-canvas': color.mix(get-color-from-palette($brand, _mode($dark, 50, 900)),
185
+ _mode($brand, #ffffff, #000000),
186
+ 2%),
187
+ 'bg-surface': color.mix(get-color-from-palette($brand, _mode($dark, 50, 900)),
188
+ get-color-from-palette('neutral', _mode($dark, 50, 1000)),
189
+ 2%),
190
+ 'bg-surface-alt': color.mix(get-color-from-palette($brand, _mode($dark, 50, 900)),
191
+ get-color-from-palette('neutral', _mode($dark, 50, 900)),
192
+ 2%),
193
+ 'bg-element': color.mix(get-color-from-palette($brand, _mode($dark, 100, 900)),
194
+ get-color-from-palette('neutral', _mode($dark, 100, 800)),
195
+ 2%),
196
+ 'bg-element-hover': color.mix(get-color-from-palette($brand, _mode($dark, 100, 900)),
197
+ get-color-from-palette('neutral', _mode($dark, 200, 700)),
198
+ 2%),
199
+ 'bg-element-active': color.mix(get-color-from-palette($brand, _mode($dark, 100, 900)),
200
+ get-color-from-palette('neutral', _mode($dark, 300, 600)),
201
+ 2%),
202
+ 'bg-neutral': color.mix(get-color-from-palette($brand, _mode($dark, 50, 900)),
203
+ get-color-from-palette('neutral', _mode($dark, 100, 900)),
204
+ 2%),
205
+ 'bg-neutral-hover': color.mix(get-color-from-palette($brand, _mode($dark, 50, 900)),
206
+ get-color-from-palette('neutral', _mode($dark, 50, 800)),
207
+ 2%),
208
+ 'bg-neutral-active': color.mix(get-color-from-palette($brand, _mode($dark, 50, 900)),
209
+ get-color-from-palette('neutral', _mode($dark, 200, 600)),
210
+ 2%),
211
+ 'text-heading': _mode($dark, get-color-from-palette('neutral', 900), #ffffff),
212
+ 'text-primary': get-color-from-palette('neutral', _mode($dark, 700, 200)),
213
+ 'text-secondary': get-color-from-palette('neutral', _mode($dark, 600, 400)),
214
+ 'text-inverse': get-color-from-palette('neutral', _mode($dark, 100, 900)),
215
+ 'border-subtle': get-color-from-palette('neutral', _mode($dark, 200, 900)),
216
+ 'border-default': get-color-from-palette('neutral', _mode($dark, 300, 800)),
217
+ 'border-strong': get-color-from-palette('neutral', _mode($dark, 400, 700)),
218
+ 'scroll-bg': get-color-from-palette('neutral', _mode($dark, 100, 900)),
219
+ 'scroll-thumb': get-color-from-palette($brand, _mode($dark, 700, 400)),
220
+ 'scroll-thumb-hover': get-color-from-palette($brand, _mode($dark, 800, 300)),
221
+ 'meta-brand-palette': $brand,
222
+ 'meta-accent-palette': $accent,
219
223
  );
220
- $merged-theme: map.merge($base, $overrides);
221
224
 
222
- @return validate-theme($merged-theme, '#{$surface-brand}-#{$accent}-dark');
225
+ @each $status,
226
+ $palette in ('info': 'information', 'success': 'success', 'warn': 'warn', 'danger': 'danger') {
227
+ $base: map.merge($base,
228
+ ('text-#{$status}': get-color-from-palette($palette, _mode($dark, 700, 400)),
229
+ 'border-#{$status}': get-color-from-palette($palette, 400),
230
+ 'bg-#{$status}': get-color-from-palette($palette, _mode($dark, 100, 900)),
231
+ 'bg-#{$status}-hover': get-color-from-palette($palette, _mode($dark, 200, 800)),
232
+ 'bg-#{$status}-active': get-color-from-palette($palette, _mode($dark, 300, 700)),
233
+ 'bg-#{$status}-disabled': get-color-from-palette($palette, _mode($dark, 50, 1000)),
234
+ 'bg-#{$status}-subtle': get-color-from-palette($palette, _mode($dark, 50, 1000)),
235
+ ));
236
+ }
237
+
238
+ $base: map.merge($base, _color-roles($brand, 'primary', $dark));
239
+ $base: map.merge($base, _color-roles($accent, 'accent', $dark));
240
+
241
+ @return validate-theme(map.merge($base, $overrides), '#{$brand}-#{$accent}');
242
+ }
243
+
244
+ /* stylelint-enable scss/at-function-pattern */
245
+ @function make-light-theme($brand, $accent: $brand, $overrides: ()) {
246
+ @return _make-theme($brand, $accent, false, $overrides);
247
+ }
248
+
249
+ @function make-dark-theme($brand, $accent: $brand, $overrides: ()) {
250
+ @return _make-theme($brand, $accent, true, $overrides);
223
251
  }
224
252
 
225
253
  @mixin bx-theme($config) {
226
- // Glass derives color from the same semantic palette as every existing component.
227
254
  --bx-glass-surface: var(--bx-bg-surface);
228
255
  --bx-glass-text: var(--bx-text-primary);
229
256
  --bx-glass-edge: var(--bx-border-default);
230
257
  --bx-glass-accent: var(--bx-primary);
231
258
 
232
259
  @each $key, $value in $config {
233
- @if $key != 'meta-brand-palette' {
260
+ @if string.index($key, 'meta-') !=1 {
234
261
  --bx-#{$key}: #{$value};
235
262
  }
263
+ }
236
264
 
237
- @if $key == 'meta-brand-palette' {
238
- $brand-palette: get-palette($value);
239
-
240
- @each $shade, $color in $brand-palette {
241
- --bx-color-primary-#{$shade}: #{$color};
242
- }
265
+ @each $role, $key in ('primary': 'meta-brand-palette', 'accent': 'meta-accent-palette') {
266
+ @each $shade, $color in get-palette(map.get($config, $key)) {
267
+ --bx-color-#{$role}-#{$shade}: #{$color};
243
268
  }
244
269
  }
245
270
  }
246
271
 
247
272
  @each $key in $required-theme-keys {
248
- @if string.index($key, 'bg-') == 1 {
273
+ @if string.index($key, 'bg-')==1 {
249
274
  .bx-#{$key} {
250
275
  background-color: var(--bx-#{$key});
251
276
  transition: background-color 0.2s ease-in-out;
252
277
  }
253
- } @else if string.index($key, 'text-') == 1 {
278
+ }
279
+
280
+ @else if string.index($key, 'text-')==1 {
254
281
  .bx-#{$key} {
255
282
  color: var(--bx-#{$key});
256
283
  transition: color 0.2s ease-in-out;
257
284
  }
258
- } @else if string.index($key, 'border-') == 1 {
285
+ }
286
+
287
+ @else if string.index($key, 'border-')==1 {
259
288
  .bx-#{$key} {
260
289
  border-color: var(--bx-#{$key});
261
290
  transition: border-color 0.2s ease-in-out;
262
291
  }
263
- } @else if not string.index($key, 'scroll-') {
292
+ }
293
+
294
+ @else if not string.index($key, 'scroll-') and string.index($key, 'meta-') !=1 {
264
295
  .bx-bg-#{$key} {
265
296
  background-color: var(--bx-#{$key});
266
297
  transition: background-color 0.2s ease-in-out;
@@ -276,4 +307,4 @@ $required-theme-keys: (
276
307
  transition: border-color 0.2s ease-in-out;
277
308
  }
278
309
  }
279
- }
310
+ }
@@ -0,0 +1,4 @@
1
+ @use '../theme-engine' as *;
2
+
3
+ $azure-coral-light-theme: make-light-theme('azure', 'coral');
4
+ $azure-coral-dark-theme: make-dark-theme('azure', 'coral');
@@ -1,4 +1,5 @@
1
- @use '../theme-engine' as *;
1
+ // Compatibility aliases. New applications should use the paired palette name.
2
+ @use 'azure-coral-theme' as paired;
2
3
 
3
- $blue-light-theme: make-light-theme('blue');
4
- $blue-dark-theme: make-dark-theme('blue');
4
+ $blue-light-theme: paired.$azure-coral-light-theme;
5
+ $blue-dark-theme: paired.$azure-coral-dark-theme;
@@ -1,4 +1,5 @@
1
1
  @use '../theme-engine' as *;
2
2
 
3
- $cyberpunk-light-theme: make-light-theme('cyber-slate', 'cyber-yellow');
4
- $cyberpunk-dark-theme: make-dark-theme('cyber-slate', 'cyber-yellow');
3
+ // Yellow actions and blue-slate supporting controls share neutral surfaces.
4
+ $cyberpunk-light-theme: make-light-theme('cyber-yellow', 'cyber-slate');
5
+ $cyberpunk-dark-theme: make-dark-theme('cyber-yellow', 'cyber-slate');
@@ -0,0 +1,19 @@
1
+ @use '../theme-engine' as *;
2
+ @use '../palettes' as *;
3
+
4
+ $graphite-sky-blue-light-theme: make-light-theme('graphite', 'sky-blue');
5
+ $graphite-sky-blue-dark-theme: make-dark-theme(
6
+ 'graphite',
7
+ 'sky-blue',
8
+ $overrides: (
9
+ 'primary': #f5f5f5,
10
+ 'primary-hover': #e5e5e5,
11
+ 'primary-active': #d4d4d4,
12
+ 'primary-subtle': get-color-from-palette('neutral', 800),
13
+ 'on-primary': #0b0b0b,
14
+ 'on-primary-hover': #0b0b0b,
15
+ 'on-primary-active': #0b0b0b,
16
+ 'text-brand': #f5f5f5,
17
+ 'border-brand': #d4d4d4,
18
+ )
19
+ );
@@ -1,4 +1,5 @@
1
- @use '../theme-engine' as *;
1
+ // Compatibility aliases. New applications should use the paired palette name.
2
+ @use 'lime-violet-theme' as paired;
2
3
 
3
- $green-light-theme: make-light-theme('green');
4
- $green-dark-theme: make-dark-theme('green');
4
+ $green-light-theme: paired.$lime-violet-light-theme;
5
+ $green-dark-theme: paired.$lime-violet-dark-theme;