@filip.mazev/blocks 1.4.10 → 1.4.12

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 (42) hide show
  1. package/README.md +15 -3
  2. package/core/styles/_choice-finish.scss +49 -0
  3. package/core/styles/_helpers.scss +1 -0
  4. package/core/styles/_index.scss +7 -0
  5. package/core/styles/_overlay.scss +4 -0
  6. package/core/styles/_palettes.scss +42 -0
  7. package/core/styles/_slider.scss +5 -5
  8. package/core/styles/_theme-engine.scss +156 -144
  9. package/core/styles/themes/_azure-coral-theme.scss +4 -0
  10. package/core/styles/themes/_blue-theme.scss +4 -3
  11. package/core/styles/themes/_cyberpunk-theme.scss +3 -2
  12. package/core/styles/themes/_graphite-sky-blue-theme.scss +19 -0
  13. package/core/styles/themes/_green-theme.scss +4 -3
  14. package/core/styles/themes/_high-contrast-theme.scss +25 -6
  15. package/core/styles/themes/_lime-violet-theme.scss +4 -0
  16. package/core/styles/themes/_orange-theme.scss +4 -3
  17. package/core/styles/themes/_purple-theme.scss +4 -3
  18. package/core/styles/themes/_red-theme.scss +4 -3
  19. package/core/styles/themes/_scarlet-cyan-theme.scss +4 -0
  20. package/core/styles/themes/_tangerine-indigo-theme.scss +4 -0
  21. package/core/styles/themes/_violet-teal-theme.scss +4 -0
  22. package/core/styles/themes/_white-theme.scss +4 -27
  23. package/effects/effects.css +4 -0
  24. package/effects/runtime/README.md +1 -1
  25. package/fesm2022/filip.mazev-blocks-core.mjs +139 -35
  26. package/fesm2022/filip.mazev-blocks-core.mjs.map +1 -1
  27. package/fesm2022/filip.mazev-blocks-effects-runtime.mjs +24 -27
  28. package/fesm2022/filip.mazev-blocks-effects-runtime.mjs.map +1 -1
  29. package/fesm2022/filip.mazev-blocks-forms.mjs +27 -61
  30. package/fesm2022/filip.mazev-blocks-forms.mjs.map +1 -1
  31. package/fesm2022/filip.mazev-blocks-primitives.mjs +496 -41
  32. package/fesm2022/filip.mazev-blocks-primitives.mjs.map +1 -1
  33. package/fesm2022/filip.mazev-blocks.mjs +1 -1
  34. package/fesm2022/filip.mazev-blocks.mjs.map +1 -1
  35. package/package.json +1 -1
  36. package/schematics/ng-add/index.d.ts +10 -1
  37. package/schematics/ng-add/index.js +15 -4
  38. package/schematics/ng-add/schema.json +23 -17
  39. package/types/filip.mazev-blocks-core.d.ts +20 -7
  40. package/types/filip.mazev-blocks-forms.d.ts +2 -3
  41. package/types/filip.mazev-blocks-primitives.d.ts +118 -4
  42. 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.
@@ -0,0 +1,49 @@
1
+ @mixin choice-well {
2
+ background-image: linear-gradient(
3
+ 180deg,
4
+ color-mix(in srgb, var(--bx-border-strong) 24%, var(--bx-glass-surface)),
5
+ var(--bx-glass-surface) 55%,
6
+ color-mix(in srgb, var(--bx-border-strong) 10%, var(--bx-glass-surface))
7
+ ) !important;
8
+ border-top-color: var(--bx-border-strong);
9
+ border-bottom-color: var(--bx-border-default);
10
+ }
11
+
12
+ @mixin choice-accent-face {
13
+ background-image: linear-gradient(
14
+ 180deg,
15
+ color-mix(in srgb, var(--bx-color-accent-50) 24%, var(--bx-accent)),
16
+ var(--bx-accent) 42%,
17
+ var(--bx-accent) 65%,
18
+ color-mix(in srgb, var(--bx-border-accent) 18%, var(--bx-accent))
19
+ ) !important;
20
+ border-top-color: color-mix(in srgb, var(--bx-color-accent-100) 60%, var(--bx-accent));
21
+ border-inline-color: var(--bx-accent);
22
+ border-bottom-color: var(--bx-border-accent);
23
+ }
24
+
25
+ @mixin choice-thumb {
26
+ background-image: radial-gradient(
27
+ circle at 32% 22%,
28
+ var(--bx-color-accent-50),
29
+ var(--bx-color-accent-100) 38%,
30
+ var(--bx-color-accent-300) 80%,
31
+ var(--bx-color-accent-400)
32
+ ) !important;
33
+ border-top-color: var(--bx-color-accent-50);
34
+ border-inline-color: var(--bx-color-accent-200);
35
+ border-bottom-color: var(--bx-color-accent-500);
36
+ }
37
+
38
+ @mixin choice-flat-accessibility {
39
+ :host-context(.high-contrast) &,
40
+ :host-context(.bx-high-contrast-scope) & {
41
+ background-image: none !important;
42
+ border-color: var(--bx-glass-edge);
43
+ }
44
+
45
+ @media (forced-colors: active) {
46
+ background-image: none !important;
47
+ border-color: ButtonText;
48
+ }
49
+ }
@@ -4,3 +4,4 @@
4
4
  @forward 'palettes';
5
5
  @forward 'motion';
6
6
  @forward 'field-state';
7
+ @forward 'choice-finish';
@@ -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,
@@ -9,7 +9,7 @@
9
9
  border-radius: radius(pill);
10
10
  background: linear-gradient(
11
11
  to right,
12
- var(--bx-primary) 0 var(--bx-slider-progress, 50%),
12
+ var(--bx-accent) 0 var(--bx-slider-progress, 50%),
13
13
  var(--bx-bg-neutral) var(--bx-slider-progress, 50%) 100%
14
14
  );
15
15
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 16%);
@@ -28,7 +28,7 @@
28
28
  var(--bx-bg-surface);
29
29
  border-color: color-mix(
30
30
  in srgb,
31
- var(--bx-slider-light-color, var(--bx-primary))
31
+ var(--bx-slider-light-color, var(--bx-accent))
32
32
  calc(var(--bx-slider-light-strength, 0.18) * 100%),
33
33
  var(--bx-border-strong)
34
34
  );
@@ -36,7 +36,7 @@
36
36
  box-shadow:
37
37
  inset 0 1px 1px rgb(255 255 255 / 45%),
38
38
  inset 0 -1px 2px
39
- color-mix(in srgb, var(--bx-slider-light-color, var(--bx-primary)) 30%, transparent),
39
+ color-mix(in srgb, var(--bx-slider-light-color, var(--bx-accent)) 30%, transparent),
40
40
  0 2px 5px rgb(0 0 0 / 18%);
41
41
  }
42
42
 
@@ -90,7 +90,7 @@
90
90
  padding: 1px;
91
91
  background: radial-gradient(
92
92
  circle at var(--bx-slider-light-x, 35%) var(--bx-slider-light-y, 0%),
93
- var(--bx-slider-light-color, var(--bx-primary)),
93
+ var(--bx-slider-light-color, var(--bx-accent)),
94
94
  transparent 75%
95
95
  );
96
96
  opacity: var(--bx-slider-light-strength, 0.25);
@@ -135,7 +135,7 @@ input.bx-slider {
135
135
  }
136
136
 
137
137
  &:focus-visible {
138
- outline: 2px solid var(--bx-border-brand);
138
+ outline: 2px solid var(--bx-border-accent);
139
139
  outline-offset: 3px;
140
140
  border-radius: radius(pill);
141
141
  }
@@ -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) {
@@ -79,167 +93,165 @@ $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
+ } @else {
112
+ $part: math.pow(math.div($part + 0.055, 1.055), 2.4);
113
+ }
114
+
115
+ $result: $result + $part * $weight;
116
+ }
117
+
118
+ @return $result;
119
+ }
120
+
121
+ @function _contrast($first, $second) {
122
+ $a: _luminance($first);
123
+ $b: _luminance($second);
124
+
125
+ @return math.div(math.max($a, $b) + 0.05, math.min($a, $b) + 0.05);
126
+ }
127
+
128
+ @function _on-color($background) {
129
+ $dark: #0b0b0b;
130
+
131
+ @if _contrast($dark, $background) < 4.5 {
132
+ $dark: #000000;
133
+ }
134
+
135
+ @if _contrast($dark, $background) >= _contrast(#ffffff, $background) {
136
+ @return $dark;
137
+ }
138
+
139
+ @return #ffffff;
140
+ }
141
+
142
+ @function _mode($dark, $light-value, $dark-value) {
143
+ @if $dark {
144
+ @return $dark-value;
145
+ }
146
+
147
+ @return $light-value;
151
148
  }
152
149
 
153
- @function make-dark-theme($surface-brand, $accent: $surface-brand, $overrides: ()) {
150
+ @function _color-roles($palette, $role, $dark) {
151
+ $base: get-color-from-palette($palette, _mode($dark, 500, 300));
152
+ $hover: get-color-from-palette($palette, _mode($dark, 600, 200));
153
+ $active: get-color-from-palette($palette, _mode($dark, 700, 100));
154
+ $subtle: get-color-from-palette($palette, _mode($dark, 100, 900));
155
+ $text: get-color-from-palette($palette, _mode($dark, 800, 200));
156
+
157
+ @if _contrast($text, $subtle) < 4.5 {
158
+ $text: _on-color($subtle);
159
+ }
160
+
161
+ $text-key: 'text-accent';
162
+ $border-key: 'border-accent';
163
+
164
+ @if $role == 'primary' {
165
+ $text-key: 'text-brand';
166
+ $border-key: 'border-brand';
167
+ }
168
+
169
+ @return (
170
+ $role: $base,
171
+ '#{$role}-hover': $hover,
172
+ '#{$role}-active': $active,
173
+ '#{$role}-subtle': $subtle,
174
+ 'on-#{$role}': _on-color($base),
175
+ 'on-#{$role}-hover': _on-color($hover),
176
+ 'on-#{$role}-active': _on-color($active),
177
+ $text-key: $text,
178
+ $border-key: get-color-from-palette($palette, _mode($dark, 800, 300))
179
+ );
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': _mode($dark, #ffffff, #000000),
185
+ 'bg-surface': get-color-from-palette('neutral', _mode($dark, 50, 1000)),
186
+ 'bg-surface-alt': get-color-from-palette('neutral', _mode($dark, 50, 900)),
187
+ 'bg-element': get-color-from-palette('neutral', _mode($dark, 100, 800)),
188
+ 'bg-element-hover': get-color-from-palette('neutral', _mode($dark, 200, 700)),
189
+ 'bg-element-active': get-color-from-palette('neutral', _mode($dark, 300, 600)),
190
+ 'bg-neutral': get-color-from-palette('neutral', _mode($dark, 100, 900)),
191
+ 'bg-neutral-hover': get-color-from-palette('neutral', _mode($dark, 50, 800)),
192
+ 'bg-neutral-active': get-color-from-palette('neutral', _mode($dark, 200, 600)),
193
+ 'text-heading': _mode($dark, get-color-from-palette('neutral', 900), #ffffff),
194
+ 'text-primary': get-color-from-palette('neutral', _mode($dark, 700, 200)),
195
+ 'text-secondary': get-color-from-palette('neutral', _mode($dark, 600, 400)),
196
+ 'text-inverse': get-color-from-palette('neutral', _mode($dark, 100, 900)),
197
+ 'border-subtle': get-color-from-palette('neutral', _mode($dark, 200, 900)),
198
+ 'border-default': get-color-from-palette('neutral', _mode($dark, 300, 800)),
199
+ 'border-strong': get-color-from-palette('neutral', _mode($dark, 400, 700)),
200
+ 'scroll-bg': get-color-from-palette('neutral', _mode($dark, 100, 900)),
201
+ 'scroll-thumb': get-color-from-palette($brand, _mode($dark, 700, 400)),
202
+ 'scroll-thumb-hover': get-color-from-palette($brand, _mode($dark, 800, 300)),
203
+ 'meta-brand-palette': $brand,
204
+ 'meta-accent-palette': $accent,
219
205
  );
220
- $merged-theme: map.merge($base, $overrides);
221
206
 
222
- @return validate-theme($merged-theme, '#{$surface-brand}-#{$accent}-dark');
207
+ @each $status,
208
+ $palette
209
+ in ('info': 'information', 'success': 'success', 'warn': 'warn', 'danger': 'danger')
210
+ {
211
+ $base: map.merge(
212
+ $base,
213
+ (
214
+ 'text-#{$status}': get-color-from-palette($palette, _mode($dark, 700, 400)),
215
+ 'border-#{$status}': get-color-from-palette($palette, 400),
216
+ 'bg-#{$status}': get-color-from-palette($palette, _mode($dark, 100, 900)),
217
+ 'bg-#{$status}-hover': get-color-from-palette($palette, _mode($dark, 200, 800)),
218
+ 'bg-#{$status}-active': get-color-from-palette($palette, _mode($dark, 300, 700)),
219
+ 'bg-#{$status}-disabled': get-color-from-palette($palette, _mode($dark, 50, 1000)),
220
+ 'bg-#{$status}-subtle': get-color-from-palette($palette, _mode($dark, 50, 1000)),
221
+ )
222
+ );
223
+ }
224
+
225
+ $base: map.merge($base, _color-roles($brand, 'primary', $dark));
226
+ $base: map.merge($base, _color-roles($accent, 'accent', $dark));
227
+
228
+ @return validate-theme(map.merge($base, $overrides), '#{$brand}-#{$accent}');
229
+ }
230
+
231
+ /* stylelint-enable scss/at-function-pattern */
232
+ @function make-light-theme($brand, $accent: $brand, $overrides: ()) {
233
+ @return _make-theme($brand, $accent, false, $overrides);
234
+ }
235
+
236
+ @function make-dark-theme($brand, $accent: $brand, $overrides: ()) {
237
+ @return _make-theme($brand, $accent, true, $overrides);
223
238
  }
224
239
 
225
240
  @mixin bx-theme($config) {
226
- // Glass derives color from the same semantic palette as every existing component.
227
241
  --bx-glass-surface: var(--bx-bg-surface);
228
242
  --bx-glass-text: var(--bx-text-primary);
229
243
  --bx-glass-edge: var(--bx-border-default);
230
244
  --bx-glass-accent: var(--bx-primary);
231
245
 
232
246
  @each $key, $value in $config {
233
- @if $key != 'meta-brand-palette' {
247
+ @if string.index($key, 'meta-') != 1 {
234
248
  --bx-#{$key}: #{$value};
235
249
  }
250
+ }
236
251
 
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
- }
252
+ @each $role, $key in ('primary': 'meta-brand-palette', 'accent': 'meta-accent-palette') {
253
+ @each $shade, $color in get-palette(map.get($config, $key)) {
254
+ --bx-color-#{$role}-#{$shade}: #{$color};
243
255
  }
244
256
  }
245
257
  }
@@ -260,7 +272,7 @@ $required-theme-keys: (
260
272
  border-color: var(--bx-#{$key});
261
273
  transition: border-color 0.2s ease-in-out;
262
274
  }
263
- } @else if not string.index($key, 'scroll-') {
275
+ } @else if not string.index($key, 'scroll-') and string.index($key, 'meta-') != 1 {
264
276
  .bx-bg-#{$key} {
265
277
  background-color: var(--bx-#{$key});
266
278
  transition: background-color 0.2s ease-in-out;
@@ -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;