@times-design-system/theme-scss 2.12.1 → 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,17 +13,40 @@ 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
 
19
- // Import layout utilities
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
+
25
+ // Import layout utilities (variables, mixin and the .tds-grid class)
20
26
  @import '@times-design-system/theme-scss/tds-layout.scss';
21
27
 
28
+ // Or import only the layout variables and mixin, without emitting any CSS
29
+ @import '@times-design-system/theme-scss/_tds-layout-tokens.scss';
30
+
22
31
  // Import a specific theme palette
23
32
  @import '@times-design-system/theme-scss/palettes/core-light.scss';
24
33
  @import '@times-design-system/theme-scss/palettes/core-dark.scss';
25
34
  ```
26
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
+
27
50
  ### Using Design Tokens in SCSS
28
51
 
29
52
  ```scss
@@ -33,7 +56,7 @@ body {
33
56
  color: $dark-core-text-primary;
34
57
  }
35
58
 
36
- // Use typography mixins located in tds-typography.scss
59
+ // Use typography mixins located in _tds-typography-tokens.scss (also available via tds-typography.scss)
37
60
  h1 {
38
61
  @include brand-heading-fluid-light-xlarge;
39
62
  margin-bottom: $spacing-200;
@@ -70,8 +93,12 @@ dist/palettes/
70
93
 
71
94
  ```
72
95
  dist/
96
+ ├── _tds-layout-tokens.scss # Layout variables and grid mixin (no CSS output)
73
97
  ├── tds-layout.scss # Layout and grid utilities
74
- ├── 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
75
102
  └── palettes/ # Theme-specific SCSS palette files
76
103
  ├── business-light.scss
77
104
  ├── business-dark.scss
@@ -0,0 +1,65 @@
1
+ $spacing-10: 18px;
2
+ $spacing-11: 20px;
3
+ $spacing-12: 23px;
4
+ $spacing-13: 24px;
5
+ $spacing-14: 28px;
6
+ $spacing-15: 32px;
7
+ $spacing-16: 36px;
8
+ $spacing-17: 40px;
9
+ $spacing-18: 48px;
10
+ $spacing-19: 56px;
11
+ $spacing-20: 64px;
12
+ $spacing-21: 80px;
13
+ $spacing-01: 2px;
14
+ $spacing-02: 3px;
15
+ $spacing-03: 4px;
16
+ $spacing-04: 6px;
17
+ $spacing-05: 8px;
18
+ $spacing-06: 10px;
19
+ $spacing-07: 12px;
20
+ $spacing-08: 14px;
21
+ $spacing-09: 16px;
22
+ $shadow-elevation-down-level-2: 0px 4px 8px 0px rgba(0,0,0,0.08);
23
+ $shadow-elevation-down-level-3: 0px 16px 24px 0px rgba(0,0,0,0.08);
24
+ $shadow-elevation-down-level-4: 0px 20px 32px 0px rgba(0,0,0,0.08);
25
+ $shadow-elevation-up-level-2: 0px -4px 8px 0px rgba(0,0,0,0.08);
26
+ $shadow-elevation-up-level-3: 0px -16px 24px 0px rgba(0,0,0,0.08);
27
+ $shadow-elevation-up-level-4: 0px -20px 32px 0px rgba(0,0,0,0.08);
28
+ $border-radius-50: 2px;
29
+ $border-radius-100: 4px;
30
+ $border-radius-150: 6px;
31
+ $border-radius-200: 8px;
32
+ $border-radius-300: 12px;
33
+ $border-radius-400: 16px;
34
+ $border-radius-full: 9999px;
35
+ $breakpoint-small: 0px;
36
+ $breakpoint-medium: 440px;
37
+ $breakpoint-large: 1024px;
38
+ $breakpoint-xLarge: 1440px;
39
+
40
+ @mixin responsive-tds-grid() {
41
+ // Mobile-first (small breakpoint)
42
+ grid-template-columns: repeat(4, 1fr);
43
+ grid-gap: 24px;
44
+ margin-inline: 20px;
45
+ max-width: 100%;
46
+
47
+ // Medium breakpoint
48
+ @media (min-width: 720px) {
49
+ grid-template-columns: repeat(12, 1fr);
50
+ grid-gap: 32px;
51
+ margin-inline: 24px;
52
+ max-width: 720px;
53
+ }
54
+
55
+ // Large breakpoint
56
+ @media (min-width: 976px) {
57
+ grid-template-columns: repeat(14, 1fr);
58
+ max-width: 976px;
59
+ }
60
+
61
+ // XLarge breakpoint
62
+ @media (min-width: 1144px) {
63
+ max-width: 1144px;
64
+ }
65
+ }