@times-design-system/theme-scss 2.13.0 → 2.14.2

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.
@@ -0,0 +1,38 @@
1
+ // Theme Class Generator
2
+ // Provides the `generate-theme-class` mixin without emitting any CSS.
3
+ //
4
+ // Use this to output only the themes you need, instead of importing
5
+ // theme-classes.scss (which emits every theme × mode):
6
+ //
7
+ // @use '@times-design-system/theme-scss/_theme-generator.scss' as tds;
8
+ // @use '@times-design-system/theme-scss/palettes/core-light' as core;
9
+ // @include tds.generate-theme-class(core.$palette, 'core');
10
+
11
+ /// Generates a theme class with all palette variables
12
+ /// Iterates over the palette map and outputs CSS custom properties
13
+ ///
14
+ /// Usage (internal):
15
+ /// @include generate-theme-class(core.$palette, 'core');
16
+ /// @include generate-theme-class(sport.$palette, 'sport');
17
+ ///
18
+ /// Parameters:
19
+ /// $palette: The palette map to iterate over
20
+ /// $theme-name: Theme name for the class (e.g., 'core', 'sport', 'culture')
21
+ /// $is-dark: Whether this is a dark mode variant (adds .theme-dark scope)
22
+
23
+ @mixin generate-theme-class($palette, $theme-name, $is-dark: false) {
24
+ @if $is-dark {
25
+ .theme-#{$theme-name}.theme-dark,
26
+ .theme-dark .theme-#{$theme-name} {
27
+ @each $key, $value in $palette {
28
+ --#{$key}: #{$value};
29
+ }
30
+ }
31
+ } @else {
32
+ .theme-#{$theme-name} {
33
+ @each $key, $value in $palette {
34
+ --#{$key}: #{$value};
35
+ }
36
+ }
37
+ }
38
+ }