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

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.
package/README.md CHANGED
@@ -13,9 +13,15 @@ yarn add @times-design-system/theme-scss
13
13
  ### Import SCSS Files
14
14
 
15
15
  ```scss
16
- // Import typography utilities
16
+ // Import typography (font-size custom properties, mixins and the typography
17
+ // classes used by components, e.g. .utility-button-medium)
17
18
  @import '@times-design-system/theme-scss/tds-typography.scss';
18
19
 
20
+ // Or import only the typography variables and mixins, without emitting any CSS
21
+ // (the mixins reference --font-size* custom properties, so tds-typography.scss
22
+ // must still be imported once at the application root)
23
+ @import '@times-design-system/theme-scss/_tds-typography-tokens.scss';
24
+
19
25
  // Import layout utilities (variables, mixin and the .tds-grid class)
20
26
  @import '@times-design-system/theme-scss/tds-layout.scss';
21
27
 
@@ -27,6 +33,20 @@ yarn add @times-design-system/theme-scss
27
33
  @import '@times-design-system/theme-scss/palettes/core-dark.scss';
28
34
  ```
29
35
 
36
+ ### Output Only the Themes You Need
37
+
38
+ `theme-classes.scss` emits a `.theme-*` class for every theme in both light and dark mode. If you only use some themes, use the `generate-theme-class` mixin from `_theme-generator.scss` (which emits no CSS on its own) with the palettes you need:
39
+
40
+ ```scss
41
+ @use '@times-design-system/theme-scss/_theme-generator.scss' as tds;
42
+ @use '@times-design-system/theme-scss/palettes/core-light' as core;
43
+ @use '@times-design-system/theme-scss/palettes/core-dark' as coreDark;
44
+
45
+ @include tds.generate-theme-class(core.$palette, 'core');
46
+ // Optional dark mode: outputs `.theme-core.theme-dark, .theme-dark .theme-core`
47
+ @include tds.generate-theme-class(coreDark.$palette, 'core', true);
48
+ ```
49
+
30
50
  ### Using Design Tokens in SCSS
31
51
 
32
52
  ```scss
@@ -36,7 +56,7 @@ body {
36
56
  color: $dark-core-text-primary;
37
57
  }
38
58
 
39
- // Use typography mixins located in tds-typography.scss
59
+ // Use typography mixins located in _tds-typography-tokens.scss (also available via tds-typography.scss)
40
60
  h1 {
41
61
  @include brand-heading-fluid-light-xlarge;
42
62
  margin-bottom: $spacing-200;
@@ -75,7 +95,10 @@ dist/palettes/
75
95
  dist/
76
96
  ├── _tds-layout-tokens.scss # Layout variables and grid mixin (no CSS output)
77
97
  ├── tds-layout.scss # Layout and grid utilities
78
- ├── tds-typography.scss # Typography mixins and utilities
98
+ ├── _tds-typography-tokens.scss # Typography variables and mixins (no CSS output)
99
+ ├── tds-typography.scss # Typography custom properties, mixins and classes
100
+ ├── _theme-generator.scss # generate-theme-class mixin (no CSS output)
101
+ ├── theme-classes.scss # .theme-* classes for every theme × mode
79
102
  └── palettes/ # Theme-specific SCSS palette files
80
103
  ├── business-light.scss
81
104
  ├── business-dark.scss