@times-design-system/theme-scss 2.9.0 → 2.10.2-alpha.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/dist/tds-typography.scss +16 -16
- package/dist/theme-apply.scss +31 -242
- package/dist/theme-classes.scss +121 -0
- package/package.json +2 -2
package/dist/tds-typography.scss
CHANGED
|
@@ -377,7 +377,7 @@ $fontLineHeight060: 2;
|
|
|
377
377
|
}
|
|
378
378
|
|
|
379
379
|
@mixin brand-subheading-light-large {
|
|
380
|
-
font: $fontWeight030 #{$
|
|
380
|
+
font: $fontWeight030 #{$fontSize050}/#{$fontLineHeight020} $fontFamily010;
|
|
381
381
|
}
|
|
382
382
|
|
|
383
383
|
@mixin brand-subheading-light-xlarge {
|
|
@@ -393,7 +393,7 @@ $fontLineHeight060: 2;
|
|
|
393
393
|
}
|
|
394
394
|
|
|
395
395
|
@mixin brand-subheading-regular-large {
|
|
396
|
-
font: $fontWeight040 #{$
|
|
396
|
+
font: $fontWeight040 #{$fontSize050}/#{$fontLineHeight020} $fontFamily010;
|
|
397
397
|
}
|
|
398
398
|
|
|
399
399
|
@mixin brand-subheading-regular-xlarge {
|
|
@@ -409,7 +409,7 @@ $fontLineHeight060: 2;
|
|
|
409
409
|
}
|
|
410
410
|
|
|
411
411
|
@mixin brand-subheading-bold-large {
|
|
412
|
-
font: $fontWeight070 #{$
|
|
412
|
+
font: $fontWeight070 #{$fontSize050}/#{$fontLineHeight020} $fontFamily010;
|
|
413
413
|
}
|
|
414
414
|
|
|
415
415
|
@mixin brand-subheading-bold-xlarge {
|
|
@@ -417,7 +417,7 @@ $fontLineHeight060: 2;
|
|
|
417
417
|
}
|
|
418
418
|
|
|
419
419
|
@mixin brand-standfirst-large {
|
|
420
|
-
font: $fontWeight040 #{$
|
|
420
|
+
font: $fontWeight040 #{$fontSize040}/#{$fontLineHeight020} $fontFamily010;
|
|
421
421
|
}
|
|
422
422
|
|
|
423
423
|
@mixin brand-standfirst-medium {
|
|
@@ -429,7 +429,7 @@ $fontLineHeight060: 2;
|
|
|
429
429
|
}
|
|
430
430
|
|
|
431
431
|
@mixin brand-paragraph-regular-medium {
|
|
432
|
-
font: #{$
|
|
432
|
+
font: #{$fontSize040}/#{$fontLineHeight040} $fontFamily020;
|
|
433
433
|
}
|
|
434
434
|
|
|
435
435
|
@mixin brand-paragraph-bold-small {
|
|
@@ -437,7 +437,7 @@ $fontLineHeight060: 2;
|
|
|
437
437
|
}
|
|
438
438
|
|
|
439
439
|
@mixin brand-paragraph-bold-medium {
|
|
440
|
-
font: #{$
|
|
440
|
+
font: #{$fontSize040}/#{$fontLineHeight040} $fontFamily030;
|
|
441
441
|
}
|
|
442
442
|
|
|
443
443
|
@mixin brand-caption-medium {
|
|
@@ -481,7 +481,7 @@ $fontLineHeight060: 2;
|
|
|
481
481
|
}
|
|
482
482
|
|
|
483
483
|
@mixin utility-subheading-large {
|
|
484
|
-
font: $fontWeight050 #{$
|
|
484
|
+
font: $fontWeight050 #{$fontSize050}/#{$fontLineHeight030} $fontFamily040;
|
|
485
485
|
}
|
|
486
486
|
|
|
487
487
|
@mixin utility-body-regular-xsmall {
|
|
@@ -501,7 +501,7 @@ $fontLineHeight060: 2;
|
|
|
501
501
|
}
|
|
502
502
|
|
|
503
503
|
@mixin utility-body-regular-large {
|
|
504
|
-
font: $fontWeight040 #{$
|
|
504
|
+
font: $fontWeight040 #{$fontSize040}/#{$fontLineHeight040} $fontFamily040;
|
|
505
505
|
}
|
|
506
506
|
|
|
507
507
|
@mixin utility-body-bold-2xsmall {
|
|
@@ -521,7 +521,7 @@ $fontLineHeight060: 2;
|
|
|
521
521
|
}
|
|
522
522
|
|
|
523
523
|
@mixin utility-body-bold-large {
|
|
524
|
-
font: $fontWeight070 #{$
|
|
524
|
+
font: $fontWeight070 #{$fontSize040}/#{$fontLineHeight040} $fontFamily040;
|
|
525
525
|
}
|
|
526
526
|
|
|
527
527
|
@mixin utility-button-xsmall {
|
|
@@ -537,7 +537,7 @@ $fontLineHeight060: 2;
|
|
|
537
537
|
}
|
|
538
538
|
|
|
539
539
|
@mixin utility-button-large {
|
|
540
|
-
font: $fontWeight050 #{$
|
|
540
|
+
font: $fontWeight050 #{$fontSize040}/#{$fontLineHeight010} $fontFamily040;
|
|
541
541
|
}
|
|
542
542
|
|
|
543
543
|
@mixin utility-label-xsmall {
|
|
@@ -553,7 +553,7 @@ $fontLineHeight060: 2;
|
|
|
553
553
|
}
|
|
554
554
|
|
|
555
555
|
@mixin utility-label-large {
|
|
556
|
-
font: $fontWeight050 #{$
|
|
556
|
+
font: $fontWeight050 #{$fontSize040}/#{$fontLineHeight020} $fontFamily040;
|
|
557
557
|
}
|
|
558
558
|
|
|
559
559
|
@mixin utility-link-inline-utility-xsmall {
|
|
@@ -569,7 +569,7 @@ $fontLineHeight060: 2;
|
|
|
569
569
|
}
|
|
570
570
|
|
|
571
571
|
@mixin utility-link-inline-utility-large {
|
|
572
|
-
font: $fontWeight070 #{$
|
|
572
|
+
font: $fontWeight070 #{$fontSize040}/#{$fontLineHeight040} $fontFamily040;
|
|
573
573
|
}
|
|
574
574
|
|
|
575
575
|
@mixin utility-link-inline-brand-xsmall {
|
|
@@ -585,7 +585,7 @@ $fontLineHeight060: 2;
|
|
|
585
585
|
}
|
|
586
586
|
|
|
587
587
|
@mixin utility-link-inline-brand-large {
|
|
588
|
-
font: $fontWeight040 #{$
|
|
588
|
+
font: $fontWeight040 #{$fontSize040}/#{$fontLineHeight040} $fontFamily020;
|
|
589
589
|
}
|
|
590
590
|
|
|
591
591
|
@mixin utility-link-standalone-utility-xsmall {
|
|
@@ -601,7 +601,7 @@ $fontLineHeight060: 2;
|
|
|
601
601
|
}
|
|
602
602
|
|
|
603
603
|
@mixin utility-link-standalone-utility-large {
|
|
604
|
-
font: $fontWeight070 #{$
|
|
604
|
+
font: $fontWeight070 #{$fontSize040}/#{$fontLineHeight040} $fontFamily040;
|
|
605
605
|
}
|
|
606
606
|
|
|
607
607
|
@mixin utility-link-standalone-brand-xsmall {
|
|
@@ -617,7 +617,7 @@ $fontLineHeight060: 2;
|
|
|
617
617
|
}
|
|
618
618
|
|
|
619
619
|
@mixin utility-link-standalone-brand-large {
|
|
620
|
-
font: $fontWeight040 #{$
|
|
620
|
+
font: $fontWeight040 #{$fontSize040}/#{$fontLineHeight040} $fontFamily020;
|
|
621
621
|
}
|
|
622
622
|
|
|
623
623
|
@mixin utility-input-label-xsmall {
|
|
@@ -633,6 +633,6 @@ $fontLineHeight060: 2;
|
|
|
633
633
|
}
|
|
634
634
|
|
|
635
635
|
@mixin utility-input-label-large {
|
|
636
|
-
font: $fontWeight040 #{$
|
|
636
|
+
font: $fontWeight040 #{$fontSize040}/#{$fontLineHeight020} $fontFamily040;
|
|
637
637
|
}
|
|
638
638
|
|
package/dist/theme-apply.scss
CHANGED
|
@@ -1,251 +1,40 @@
|
|
|
1
|
-
// Theme
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// Theme Variable Helper
|
|
2
|
+
// Lightweight mixin for components to reference theme CSS variables
|
|
3
|
+
//
|
|
4
|
+
// IMPORTANT: This file works in conjunction with theme-classes.scss
|
|
5
|
+
//
|
|
6
|
+
// theme-classes.scss generates all CSS variable definitions by iterating over
|
|
7
|
+
// palette maps (one output per theme × mode combination, minimal DOM footprint)
|
|
8
|
+
//
|
|
9
|
+
// This file provides optional helper mixins for convenient variable access
|
|
10
|
+
//
|
|
11
|
+
// Import flow:
|
|
12
|
+
// 1. Import theme-classes.scss first to output all --token-name variables
|
|
13
|
+
// 2. Components then reference variables via var(--token-name)
|
|
14
|
+
// 3. Or use helper mixins below for additional convenience
|
|
15
|
+
//
|
|
16
|
+
// Example component usage:
|
|
17
|
+
// .tds-chip {
|
|
18
|
+
// color: var(--text-primary); // Direct reference
|
|
19
|
+
// background: @include token-var('surface-canvas'); // Via helper
|
|
20
|
+
// }
|
|
6
21
|
|
|
7
|
-
|
|
8
|
-
@use './palettes/core-light' as core;
|
|
9
|
-
@use './palettes/sport-light' as sport;
|
|
10
|
-
@use './palettes/culture-light' as culture;
|
|
11
|
-
@use './palettes/comment-light' as comment;
|
|
12
|
-
@use './palettes/home-light' as home;
|
|
13
|
-
@use './palettes/business-light' as business;
|
|
14
|
-
@use './palettes/travel-light' as travel;
|
|
15
|
-
@use './palettes/uk-light' as uk;
|
|
16
|
-
@use './palettes/world-light' as world;
|
|
17
|
-
@use './palettes/money-light' as money;
|
|
18
|
-
@use './palettes/puzzles-light' as puzzles;
|
|
19
|
-
@use './palettes/lifeAndStyle-light' as lifeAndStyle;
|
|
20
|
-
@use './palettes/obituaries-light' as obituaries;
|
|
21
|
-
@use './palettes/ireland-light' as ireland;
|
|
22
|
-
@use './palettes/magazineLuxx-light' as magazineLuxx;
|
|
23
|
-
@use './palettes/magazineSundayTimes-light' as magazineSundayTimes;
|
|
24
|
-
@use './palettes/magazineTimes-light' as magazineTimes;
|
|
25
|
-
@use './palettes/timesPlus-light' as timesPlus;
|
|
26
|
-
@use './palettes/timesEvents-light' as timesEvents;
|
|
27
|
-
@use './palettes/timesRadio-light' as timesRadio;
|
|
28
|
-
|
|
29
|
-
// Dark mode palettes
|
|
30
|
-
@use './palettes/core-dark' as coreDark;
|
|
31
|
-
@use './palettes/sport-dark' as sportDark;
|
|
32
|
-
@use './palettes/culture-dark' as cultureDark;
|
|
33
|
-
@use './palettes/comment-dark' as commentDark;
|
|
34
|
-
@use './palettes/home-dark' as homeDark;
|
|
35
|
-
@use './palettes/business-dark' as businessDark;
|
|
36
|
-
@use './palettes/travel-dark' as travelDark;
|
|
37
|
-
@use './palettes/uk-dark' as ukDark;
|
|
38
|
-
@use './palettes/world-dark' as worldDark;
|
|
39
|
-
@use './palettes/money-dark' as moneyDark;
|
|
40
|
-
@use './palettes/puzzles-dark' as puzzlesDark;
|
|
41
|
-
@use './palettes/lifeAndStyle-dark' as lifeAndStyleDark;
|
|
42
|
-
@use './palettes/obituaries-dark' as obituariesDark;
|
|
43
|
-
@use './palettes/ireland-dark' as irelandDark;
|
|
44
|
-
@use './palettes/magazineLuxx-dark' as magazineLuxxDark;
|
|
45
|
-
@use './palettes/magazineSundayTimes-dark' as magazineSundayTimesDark;
|
|
46
|
-
@use './palettes/magazineTimes-dark' as magazineTimesDark;
|
|
47
|
-
@use './palettes/timesPlus-dark' as timesPlusDark;
|
|
48
|
-
@use './palettes/timesEvents-dark' as timesEventsDark;
|
|
49
|
-
@use './palettes/timesRadio-dark' as timesRadioDark;
|
|
50
|
-
|
|
51
|
-
/// Apply a single token value across all theme/mode combinations
|
|
52
|
-
/// Generates theme-scoped selectors on-demand for properties you actually use
|
|
22
|
+
/// Convenience helper to output a CSS variable reference
|
|
53
23
|
///
|
|
54
24
|
/// Usage examples:
|
|
55
|
-
/// @include
|
|
56
|
-
/// @include
|
|
57
|
-
/// @include theme-value('border-color', 'border-primary');
|
|
25
|
+
/// color: @include token-var('text-primary');
|
|
26
|
+
/// background: @include token-var('surface-canvas');
|
|
58
27
|
///
|
|
59
28
|
/// Parameters:
|
|
60
|
-
/// $
|
|
61
|
-
/// $
|
|
62
|
-
/// Examples: 'text-primary', 'surface-canvas', 'border-primary', 'surface-level-1'
|
|
29
|
+
/// $token-name: Token key from palette (e.g., 'text-primary', 'surface-canvas')
|
|
30
|
+
/// $fallback: Optional fallback value if CSS variable is not defined
|
|
63
31
|
///
|
|
64
|
-
///
|
|
65
|
-
/// Example output from @include theme-value('color', 'text-primary');
|
|
66
|
-
/// .component { color: [core light value]; }
|
|
67
|
-
/// [data-mode="dark"] .component { color: [core dark value]; }
|
|
68
|
-
/// [data-theme="sport"] .component { color: [sport light value]; }
|
|
69
|
-
/// [data-theme="sport"][data-mode="dark"] .component { color: [sport dark value]; }
|
|
70
|
-
/// ... (etc for all themes)
|
|
32
|
+
/// Output: var(--#{$token-name}, $fallback)
|
|
71
33
|
|
|
72
|
-
@
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
[data-mode="dark"] & {
|
|
78
|
-
#{$property}: map-get(coreDark.$palette, $token-name);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// Sport theme
|
|
82
|
-
[data-theme="sport"] & {
|
|
83
|
-
#{$property}: map-get(sport.$palette, $token-name);
|
|
84
|
-
|
|
85
|
-
&[data-mode="dark"] {
|
|
86
|
-
#{$property}: map-get(sportDark.$palette, $token-name);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// Culture theme
|
|
91
|
-
[data-theme="culture"] & {
|
|
92
|
-
#{$property}: map-get(culture.$palette, $token-name);
|
|
93
|
-
|
|
94
|
-
&[data-mode="dark"] {
|
|
95
|
-
#{$property}: map-get(cultureDark.$palette, $token-name);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// Comment theme
|
|
100
|
-
[data-theme="comment"] & {
|
|
101
|
-
#{$property}: map-get(comment.$palette, $token-name);
|
|
102
|
-
|
|
103
|
-
&[data-mode="dark"] {
|
|
104
|
-
#{$property}: map-get(commentDark.$palette, $token-name);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// Home theme
|
|
109
|
-
[data-theme="home"] & {
|
|
110
|
-
#{$property}: map-get(home.$palette, $token-name);
|
|
111
|
-
|
|
112
|
-
&[data-mode="dark"] {
|
|
113
|
-
#{$property}: map-get(homeDark.$palette, $token-name);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// Business theme
|
|
118
|
-
[data-theme="business"] & {
|
|
119
|
-
#{$property}: map-get(business.$palette, $token-name);
|
|
120
|
-
|
|
121
|
-
&[data-mode="dark"] {
|
|
122
|
-
#{$property}: map-get(businessDark.$palette, $token-name);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// Travel theme
|
|
127
|
-
[data-theme="travel"] & {
|
|
128
|
-
#{$property}: map-get(travel.$palette, $token-name);
|
|
129
|
-
|
|
130
|
-
&[data-mode="dark"] {
|
|
131
|
-
#{$property}: map-get(travelDark.$palette, $token-name);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// UK theme
|
|
136
|
-
[data-theme="uk"] & {
|
|
137
|
-
#{$property}: map-get(uk.$palette, $token-name);
|
|
138
|
-
|
|
139
|
-
&[data-mode="dark"] {
|
|
140
|
-
#{$property}: map-get(ukDark.$palette, $token-name);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
// World theme
|
|
145
|
-
[data-theme="world"] & {
|
|
146
|
-
#{$property}: map-get(world.$palette, $token-name);
|
|
147
|
-
|
|
148
|
-
&[data-mode="dark"] {
|
|
149
|
-
#{$property}: map-get(worldDark.$palette, $token-name);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
// Money theme
|
|
154
|
-
[data-theme="money"] & {
|
|
155
|
-
#{$property}: map-get(money.$palette, $token-name);
|
|
156
|
-
|
|
157
|
-
&[data-mode="dark"] {
|
|
158
|
-
#{$property}: map-get(moneyDark.$palette, $token-name);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
// Puzzles theme
|
|
163
|
-
[data-theme="puzzles"] & {
|
|
164
|
-
#{$property}: map-get(puzzles.$palette, $token-name);
|
|
165
|
-
|
|
166
|
-
&[data-mode="dark"] {
|
|
167
|
-
#{$property}: map-get(puzzlesDark.$palette, $token-name);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// Life & Style theme
|
|
172
|
-
[data-theme="lifeAndStyle"] & {
|
|
173
|
-
#{$property}: map-get(lifeAndStyle.$palette, $token-name);
|
|
174
|
-
|
|
175
|
-
&[data-mode="dark"] {
|
|
176
|
-
#{$property}: map-get(lifeAndStyleDark.$palette, $token-name);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
// Obituaries theme
|
|
181
|
-
[data-theme="obituaries"] & {
|
|
182
|
-
#{$property}: map-get(obituaries.$palette, $token-name);
|
|
183
|
-
|
|
184
|
-
&[data-mode="dark"] {
|
|
185
|
-
#{$property}: map-get(obituariesDark.$palette, $token-name);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// Ireland theme
|
|
190
|
-
[data-theme="ireland"] & {
|
|
191
|
-
#{$property}: map-get(ireland.$palette, $token-name);
|
|
192
|
-
|
|
193
|
-
&[data-mode="dark"] {
|
|
194
|
-
#{$property}: map-get(irelandDark.$palette, $token-name);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
// Magazine Luxx theme
|
|
199
|
-
[data-theme="magazineLuxx"] & {
|
|
200
|
-
#{$property}: map-get(magazineLuxx.$palette, $token-name);
|
|
201
|
-
|
|
202
|
-
&[data-mode="dark"] {
|
|
203
|
-
#{$property}: map-get(magazineLuxxDark.$palette, $token-name);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
// Magazine Sunday Times theme
|
|
208
|
-
[data-theme="magazineSundayTimes"] & {
|
|
209
|
-
#{$property}: map-get(magazineSundayTimes.$palette, $token-name);
|
|
210
|
-
|
|
211
|
-
&[data-mode="dark"] {
|
|
212
|
-
#{$property}: map-get(magazineSundayTimesDark.$palette, $token-name);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
// Magazine Times theme
|
|
217
|
-
[data-theme="magazineTimes"] & {
|
|
218
|
-
#{$property}: map-get(magazineTimes.$palette, $token-name);
|
|
219
|
-
|
|
220
|
-
&[data-mode="dark"] {
|
|
221
|
-
#{$property}: map-get(magazineTimesDark.$palette, $token-name);
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
// Times+ theme
|
|
226
|
-
[data-theme="timesPlus"] & {
|
|
227
|
-
#{$property}: map-get(timesPlus.$palette, $token-name);
|
|
228
|
-
|
|
229
|
-
&[data-mode="dark"] {
|
|
230
|
-
#{$property}: map-get(timesPlusDark.$palette, $token-name);
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
// Times Events theme
|
|
235
|
-
[data-theme="timesEvents"] & {
|
|
236
|
-
#{$property}: map-get(timesEvents.$palette, $token-name);
|
|
237
|
-
|
|
238
|
-
&[data-mode="dark"] {
|
|
239
|
-
#{$property}: map-get(timesEventsDark.$palette, $token-name);
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
// Times Radio theme
|
|
244
|
-
[data-theme="timesRadio"] & {
|
|
245
|
-
#{$property}: map-get(timesRadio.$palette, $token-name);
|
|
246
|
-
|
|
247
|
-
&[data-mode="dark"] {
|
|
248
|
-
#{$property}: map-get(timesRadioDark.$palette, $token-name);
|
|
249
|
-
}
|
|
34
|
+
@function token-var($token-name, $fallback: null) {
|
|
35
|
+
@if $fallback {
|
|
36
|
+
@return var(--#{$token-name}, $fallback);
|
|
37
|
+
} @else {
|
|
38
|
+
@return var(--#{$token-name});
|
|
250
39
|
}
|
|
251
40
|
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
// Theme Classes Generator
|
|
2
|
+
// Automatically generates theme-scoped CSS variable classes by iterating over palette maps
|
|
3
|
+
// Outputs one set of variables per theme × mode combination (minimal DOM footprint)
|
|
4
|
+
// All components simply reference the variables via var(--token-name)
|
|
5
|
+
|
|
6
|
+
// Light mode palettes
|
|
7
|
+
@use './palettes/core-light' as core;
|
|
8
|
+
@use './palettes/sport-light' as sport;
|
|
9
|
+
@use './palettes/culture-light' as culture;
|
|
10
|
+
@use './palettes/comment-light' as comment;
|
|
11
|
+
@use './palettes/home-light' as home;
|
|
12
|
+
@use './palettes/business-light' as business;
|
|
13
|
+
@use './palettes/travel-light' as travel;
|
|
14
|
+
@use './palettes/uk-light' as uk;
|
|
15
|
+
@use './palettes/world-light' as world;
|
|
16
|
+
@use './palettes/money-light' as money;
|
|
17
|
+
@use './palettes/puzzles-light' as puzzles;
|
|
18
|
+
@use './palettes/lifeAndStyle-light' as lifeAndStyle;
|
|
19
|
+
@use './palettes/obituaries-light' as obituaries;
|
|
20
|
+
@use './palettes/ireland-light' as ireland;
|
|
21
|
+
@use './palettes/magazineLuxx-light' as magazineLuxx;
|
|
22
|
+
@use './palettes/magazineSundayTimes-light' as magazineSundayTimes;
|
|
23
|
+
@use './palettes/magazineTimes-light' as magazineTimes;
|
|
24
|
+
@use './palettes/timesPlus-light' as timesPlus;
|
|
25
|
+
@use './palettes/timesEvents-light' as timesEvents;
|
|
26
|
+
@use './palettes/timesRadio-light' as timesRadio;
|
|
27
|
+
|
|
28
|
+
// Dark mode palettes
|
|
29
|
+
@use './palettes/core-dark' as coreDark;
|
|
30
|
+
@use './palettes/sport-dark' as sportDark;
|
|
31
|
+
@use './palettes/culture-dark' as cultureDark;
|
|
32
|
+
@use './palettes/comment-dark' as commentDark;
|
|
33
|
+
@use './palettes/home-dark' as homeDark;
|
|
34
|
+
@use './palettes/business-dark' as businessDark;
|
|
35
|
+
@use './palettes/travel-dark' as travelDark;
|
|
36
|
+
@use './palettes/uk-dark' as ukDark;
|
|
37
|
+
@use './palettes/world-dark' as worldDark;
|
|
38
|
+
@use './palettes/money-dark' as moneyDark;
|
|
39
|
+
@use './palettes/puzzles-dark' as puzzlesDark;
|
|
40
|
+
@use './palettes/lifeAndStyle-dark' as lifeAndStyleDark;
|
|
41
|
+
@use './palettes/obituaries-dark' as obituariesDark;
|
|
42
|
+
@use './palettes/ireland-dark' as irelandDark;
|
|
43
|
+
@use './palettes/magazineLuxx-dark' as magazineLuxxDark;
|
|
44
|
+
@use './palettes/magazineSundayTimes-dark' as magazineSundayTimesDark;
|
|
45
|
+
@use './palettes/magazineTimes-dark' as magazineTimesDark;
|
|
46
|
+
@use './palettes/timesPlus-dark' as timesPlusDark;
|
|
47
|
+
@use './palettes/timesEvents-dark' as timesEventsDark;
|
|
48
|
+
@use './palettes/timesRadio-dark' as timesRadioDark;
|
|
49
|
+
|
|
50
|
+
/// Generates a theme class with all palette variables
|
|
51
|
+
/// Iterates over the palette map and outputs CSS custom properties
|
|
52
|
+
///
|
|
53
|
+
/// Usage (internal):
|
|
54
|
+
/// @include generate-theme-class(core.$palette, 'core');
|
|
55
|
+
/// @include generate-theme-class(sport.$palette, 'sport');
|
|
56
|
+
///
|
|
57
|
+
/// Parameters:
|
|
58
|
+
/// $palette: The palette map to iterate over
|
|
59
|
+
/// $theme-name: Theme name for the class (e.g., 'core', 'sport', 'culture')
|
|
60
|
+
/// $is-dark: Whether this is a dark mode variant (adds .theme-dark scope)
|
|
61
|
+
|
|
62
|
+
@mixin generate-theme-class($palette, $theme-name, $is-dark: false) {
|
|
63
|
+
@if $is-dark {
|
|
64
|
+
.theme-#{$theme-name}.theme-dark,
|
|
65
|
+
.theme-dark .theme-#{$theme-name} {
|
|
66
|
+
@each $key, $value in $palette {
|
|
67
|
+
--#{$key}: #{$value};
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
} @else {
|
|
71
|
+
.theme-#{$theme-name} {
|
|
72
|
+
@each $key, $value in $palette {
|
|
73
|
+
--#{$key}: #{$value};
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// === LIGHT MODE ===
|
|
80
|
+
@include generate-theme-class(core.$palette, 'core');
|
|
81
|
+
@include generate-theme-class(sport.$palette, 'sport');
|
|
82
|
+
@include generate-theme-class(culture.$palette, 'culture');
|
|
83
|
+
@include generate-theme-class(comment.$palette, 'comment');
|
|
84
|
+
@include generate-theme-class(home.$palette, 'home');
|
|
85
|
+
@include generate-theme-class(business.$palette, 'business');
|
|
86
|
+
@include generate-theme-class(travel.$palette, 'travel');
|
|
87
|
+
@include generate-theme-class(uk.$palette, 'uk');
|
|
88
|
+
@include generate-theme-class(world.$palette, 'world');
|
|
89
|
+
@include generate-theme-class(money.$palette, 'money');
|
|
90
|
+
@include generate-theme-class(puzzles.$palette, 'puzzles');
|
|
91
|
+
@include generate-theme-class(lifeAndStyle.$palette, 'lifeAndStyle');
|
|
92
|
+
@include generate-theme-class(obituaries.$palette, 'obituaries');
|
|
93
|
+
@include generate-theme-class(ireland.$palette, 'ireland');
|
|
94
|
+
@include generate-theme-class(magazineLuxx.$palette, 'magazineLuxx');
|
|
95
|
+
@include generate-theme-class(magazineSundayTimes.$palette, 'magazineSundayTimes');
|
|
96
|
+
@include generate-theme-class(magazineTimes.$palette, 'magazineTimes');
|
|
97
|
+
@include generate-theme-class(timesPlus.$palette, 'timesPlus');
|
|
98
|
+
@include generate-theme-class(timesEvents.$palette, 'timesEvents');
|
|
99
|
+
@include generate-theme-class(timesRadio.$palette, 'timesRadio');
|
|
100
|
+
|
|
101
|
+
// === DARK MODE ===
|
|
102
|
+
@include generate-theme-class(coreDark.$palette, 'core', true);
|
|
103
|
+
@include generate-theme-class(sportDark.$palette, 'sport', true);
|
|
104
|
+
@include generate-theme-class(cultureDark.$palette, 'culture', true);
|
|
105
|
+
@include generate-theme-class(commentDark.$palette, 'comment', true);
|
|
106
|
+
@include generate-theme-class(homeDark.$palette, 'home', true);
|
|
107
|
+
@include generate-theme-class(businessDark.$palette, 'business', true);
|
|
108
|
+
@include generate-theme-class(travelDark.$palette, 'travel', true);
|
|
109
|
+
@include generate-theme-class(ukDark.$palette, 'uk', true);
|
|
110
|
+
@include generate-theme-class(worldDark.$palette, 'world', true);
|
|
111
|
+
@include generate-theme-class(moneyDark.$palette, 'money', true);
|
|
112
|
+
@include generate-theme-class(puzzlesDark.$palette, 'puzzles', true);
|
|
113
|
+
@include generate-theme-class(lifeAndStyleDark.$palette, 'lifeAndStyle', true);
|
|
114
|
+
@include generate-theme-class(obituariesDark.$palette, 'obituaries', true);
|
|
115
|
+
@include generate-theme-class(irelandDark.$palette, 'ireland', true);
|
|
116
|
+
@include generate-theme-class(magazineLuxxDark.$palette, 'magazineLuxx', true);
|
|
117
|
+
@include generate-theme-class(magazineSundayTimesDark.$palette, 'magazineSundayTimes', true);
|
|
118
|
+
@include generate-theme-class(magazineTimesDark.$palette, 'magazineTimes', true);
|
|
119
|
+
@include generate-theme-class(timesPlusDark.$palette, 'timesPlus', true);
|
|
120
|
+
@include generate-theme-class(timesEventsDark.$palette, 'timesEvents', true);
|
|
121
|
+
@include generate-theme-class(timesRadioDark.$palette, 'timesRadio', true);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@times-design-system/theme-scss",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.2-alpha.0+91f353d4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Times Design System theme package - pre-resolved color tokens for React",
|
|
6
6
|
"keywords": [
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"url": "https://github.com/newsuk/times-design-system/issues"
|
|
45
45
|
},
|
|
46
46
|
"homepage": "https://github.com/newsuk/times-design-system#readme",
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "91f353d41d06d1066d2345a933d6e9b58ae54a1d"
|
|
48
48
|
}
|