@rxap/ngx-theme 19.0.3 → 19.1.0-dev.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/CHANGELOG.md +10 -0
- package/README.md +85 -0
- package/compodoc/changelog.html +7 -0
- package/compodoc/dependencies.html +6 -6
- package/compodoc/index.html +69 -1
- package/compodoc/injectables/ThemeModeService.html +1256 -0
- package/compodoc/injectables/ThemeService.html +82 -265
- package/compodoc/interfaces/ColorPaletteConfig.html +6 -71
- package/compodoc/interfaces/ColorPaletteConfigWithName.html +6 -71
- package/compodoc/interfaces/ThemeConfig.html +6 -71
- package/compodoc/js/menu-wc.js +6 -0
- package/compodoc/js/menu-wc_es5.js +1 -1
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/miscellaneous/typealiases.html +235 -0
- package/compodoc/miscellaneous/variables.html +32 -0
- package/compodoc/overview.html +1 -1
- package/compodoc/properties.html +1 -1
- package/docs/documentation.json +1672 -532
- package/docs/html/assets/hierarchy.js +1 -1
- package/docs/html/assets/highlight.css +28 -0
- package/docs/html/assets/navigation.js +1 -1
- package/docs/html/assets/search.js +1 -1
- package/docs/html/classes/ThemeModeService.html +35 -0
- package/docs/html/classes/ThemeService.html +4 -6
- package/docs/html/enums/ColorPaletteAlgorithm.html +2 -2
- package/docs/html/functions/ComputeColorPalette.html +1 -1
- package/docs/html/functions/ObserveCurrentThemeDensity.html +1 -1
- package/docs/html/functions/provideTheme.html +1 -1
- package/docs/html/hierarchy.html +1 -1
- package/docs/html/index.html +60 -2
- package/docs/html/interfaces/ColorPalette.html +2 -2
- package/docs/html/interfaces/ColorPaletteConfig.html +2 -2
- package/docs/html/interfaces/ColorPaletteConfigWithName.html +2 -2
- package/docs/html/interfaces/ThemeConfig.html +2 -2
- package/docs/html/modules.html +1 -1
- package/docs/html/types/ActiveTheme.html +1 -0
- package/docs/html/types/ThemeSetting.html +1 -0
- package/docs/html/variables/THEME_SETTING_KEY.html +1 -0
- package/docs/markdown/README.md +86 -1
- package/docs/markdown/classes/ThemeModeService.md +282 -0
- package/docs/markdown/classes/ThemeService.md +39 -69
- package/docs/markdown/enumerations/ColorPaletteAlgorithm.md +4 -4
- package/docs/markdown/functions/ComputeColorPalette.md +2 -2
- package/docs/markdown/functions/ObserveCurrentThemeDensity.md +2 -2
- package/docs/markdown/functions/provideTheme.md +2 -2
- package/docs/markdown/globals.md +12 -2
- package/docs/markdown/interfaces/ColorPalette.md +16 -16
- package/docs/markdown/interfaces/ColorPaletteConfig.md +5 -5
- package/docs/markdown/interfaces/ColorPaletteConfigWithName.md +6 -6
- package/docs/markdown/interfaces/ThemeConfig.md +7 -7
- package/docs/markdown/type-aliases/ActiveTheme.md +11 -0
- package/docs/markdown/type-aliases/ThemeSetting.md +11 -0
- package/docs/markdown/variables/THEME_SETTING_KEY.md +11 -0
- package/docs/wiki/Class.ThemeModeService.md +278 -0
- package/docs/wiki/Class.ThemeService.md +38 -68
- package/docs/wiki/Enumeration.ColorPaletteAlgorithm.md +3 -3
- package/docs/wiki/Function.ComputeColorPalette.md +1 -1
- package/docs/wiki/Function.ObserveCurrentThemeDensity.md +1 -1
- package/docs/wiki/Function.provideTheme.md +1 -1
- package/docs/wiki/Home.md +85 -0
- package/docs/wiki/Interface.ColorPalette.md +15 -15
- package/docs/wiki/Interface.ColorPaletteConfig.md +4 -4
- package/docs/wiki/Interface.ColorPaletteConfigWithName.md +5 -5
- package/docs/wiki/Interface.ThemeConfig.md +6 -6
- package/docs/wiki/TypeAlias.ActiveTheme.md +7 -0
- package/docs/wiki/TypeAlias.ThemeSetting.md +7 -0
- package/docs/wiki/Variable.THEME_SETTING_KEY.md +7 -0
- package/docs/wiki/_Sidebar.md +10 -0
- package/docs/wiki/globals.md +11 -1
- package/fesm2022/rxap-ngx-theme.mjs +145 -64
- package/fesm2022/rxap-ngx-theme.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/lib/theme-mode.service.d.ts +61 -0
- package/lib/theme.service.d.ts +3 -5
- package/package.json +16 -16
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Class: ThemeService
|
|
4
4
|
|
|
5
|
-
Defined in: [theme.service.ts:
|
|
5
|
+
Defined in: [theme.service.ts:47](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L47)
|
|
6
6
|
|
|
7
7
|
## Constructors
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ Defined in: [theme.service.ts:46](https://gitlab.com/rxap/packages/-/blob/15b5fa
|
|
|
10
10
|
|
|
11
11
|
> **new ThemeService**(`mediaMatcher`): [`ThemeService`](../wiki/Class.ThemeService)
|
|
12
12
|
|
|
13
|
-
Defined in: [theme.service.ts:
|
|
13
|
+
Defined in: [theme.service.ts:61](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L61)
|
|
14
14
|
|
|
15
15
|
#### Parameters
|
|
16
16
|
|
|
@@ -28,23 +28,15 @@ Defined in: [theme.service.ts:60](https://gitlab.com/rxap/packages/-/blob/15b5fa
|
|
|
28
28
|
|
|
29
29
|
> `readonly` **config**: `ConfigService`\<`any`\>
|
|
30
30
|
|
|
31
|
-
Defined in: [theme.service.ts:
|
|
31
|
+
Defined in: [theme.service.ts:49](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L49)
|
|
32
32
|
|
|
33
33
|
***
|
|
34
34
|
|
|
35
35
|
### darkMode
|
|
36
36
|
|
|
37
|
-
> `readonly` **darkMode**: `
|
|
37
|
+
> `readonly` **darkMode**: `Signal`\<`boolean`\>
|
|
38
38
|
|
|
39
|
-
Defined in: [theme.service.ts:
|
|
40
|
-
|
|
41
|
-
***
|
|
42
|
-
|
|
43
|
-
### darkModeMediaQuery
|
|
44
|
-
|
|
45
|
-
> `protected` `readonly` **darkModeMediaQuery**: `MediaQueryList`
|
|
46
|
-
|
|
47
|
-
Defined in: [theme.service.ts:56](https://gitlab.com/rxap/packages/-/blob/15b5fab8912b1042ea325e7f4d98844416018df1/packages/angular/theme/src/lib/theme.service.ts#L56)
|
|
39
|
+
Defined in: [theme.service.ts:54](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L54)
|
|
48
40
|
|
|
49
41
|
***
|
|
50
42
|
|
|
@@ -52,7 +44,7 @@ Defined in: [theme.service.ts:56](https://gitlab.com/rxap/packages/-/blob/15b5fa
|
|
|
52
44
|
|
|
53
45
|
> `readonly` **density**: `WritableSignal`\<`ThemeDensity`\>
|
|
54
46
|
|
|
55
|
-
Defined in: [theme.service.ts:
|
|
47
|
+
Defined in: [theme.service.ts:56](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L56)
|
|
56
48
|
|
|
57
49
|
***
|
|
58
50
|
|
|
@@ -60,7 +52,7 @@ Defined in: [theme.service.ts:53](https://gitlab.com/rxap/packages/-/blob/15b5fa
|
|
|
60
52
|
|
|
61
53
|
> `readonly` **pubSub**: `PubSubService`
|
|
62
54
|
|
|
63
|
-
Defined in: [theme.service.ts:
|
|
55
|
+
Defined in: [theme.service.ts:50](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L50)
|
|
64
56
|
|
|
65
57
|
***
|
|
66
58
|
|
|
@@ -68,7 +60,15 @@ Defined in: [theme.service.ts:49](https://gitlab.com/rxap/packages/-/blob/15b5fa
|
|
|
68
60
|
|
|
69
61
|
> `protected` `optional` **syncSubscription**: `Subscription`
|
|
70
62
|
|
|
71
|
-
Defined in: [theme.service.ts:
|
|
63
|
+
Defined in: [theme.service.ts:59](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L59)
|
|
64
|
+
|
|
65
|
+
***
|
|
66
|
+
|
|
67
|
+
### themeModeService
|
|
68
|
+
|
|
69
|
+
> `readonly` **themeModeService**: [`ThemeModeService`](../wiki/Class.ThemeModeService)
|
|
70
|
+
|
|
71
|
+
Defined in: [theme.service.ts:52](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L52)
|
|
72
72
|
|
|
73
73
|
***
|
|
74
74
|
|
|
@@ -76,7 +76,7 @@ Defined in: [theme.service.ts:58](https://gitlab.com/rxap/packages/-/blob/15b5fa
|
|
|
76
76
|
|
|
77
77
|
> `readonly` **themeName**: `WritableSignal`\<`string`\>
|
|
78
78
|
|
|
79
|
-
Defined in: [theme.service.ts:
|
|
79
|
+
Defined in: [theme.service.ts:55](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L55)
|
|
80
80
|
|
|
81
81
|
***
|
|
82
82
|
|
|
@@ -84,33 +84,15 @@ Defined in: [theme.service.ts:52](https://gitlab.com/rxap/packages/-/blob/15b5fa
|
|
|
84
84
|
|
|
85
85
|
> `readonly` **typography**: `WritableSignal`\<`string`\>
|
|
86
86
|
|
|
87
|
-
Defined in: [theme.service.ts:
|
|
87
|
+
Defined in: [theme.service.ts:57](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L57)
|
|
88
88
|
|
|
89
89
|
## Methods
|
|
90
90
|
|
|
91
|
-
### applyDarkMode()
|
|
92
|
-
|
|
93
|
-
> **applyDarkMode**(`darkMode`): `void`
|
|
94
|
-
|
|
95
|
-
Defined in: [theme.service.ts:258](https://gitlab.com/rxap/packages/-/blob/15b5fab8912b1042ea325e7f4d98844416018df1/packages/angular/theme/src/lib/theme.service.ts#L258)
|
|
96
|
-
|
|
97
|
-
#### Parameters
|
|
98
|
-
|
|
99
|
-
##### darkMode
|
|
100
|
-
|
|
101
|
-
`boolean`
|
|
102
|
-
|
|
103
|
-
#### Returns
|
|
104
|
-
|
|
105
|
-
`void`
|
|
106
|
-
|
|
107
|
-
***
|
|
108
|
-
|
|
109
91
|
### applyDensity()
|
|
110
92
|
|
|
111
93
|
> **applyDensity**(`density`): `void`
|
|
112
94
|
|
|
113
|
-
Defined in: [theme.service.ts:
|
|
95
|
+
Defined in: [theme.service.ts:209](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L209)
|
|
114
96
|
|
|
115
97
|
#### Parameters
|
|
116
98
|
|
|
@@ -128,7 +110,7 @@ Defined in: [theme.service.ts:274](https://gitlab.com/rxap/packages/-/blob/15b5f
|
|
|
128
110
|
|
|
129
111
|
> **applyTheme**(`themeName`): `void`
|
|
130
112
|
|
|
131
|
-
Defined in: [theme.service.ts:
|
|
113
|
+
Defined in: [theme.service.ts:220](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L220)
|
|
132
114
|
|
|
133
115
|
#### Parameters
|
|
134
116
|
|
|
@@ -146,7 +128,7 @@ Defined in: [theme.service.ts:285](https://gitlab.com/rxap/packages/-/blob/15b5f
|
|
|
146
128
|
|
|
147
129
|
> **applyTypography**(`typography`): `void`
|
|
148
130
|
|
|
149
|
-
Defined in: [theme.service.ts:
|
|
131
|
+
Defined in: [theme.service.ts:216](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L216)
|
|
150
132
|
|
|
151
133
|
#### Parameters
|
|
152
134
|
|
|
@@ -164,7 +146,7 @@ Defined in: [theme.service.ts:281](https://gitlab.com/rxap/packages/-/blob/15b5f
|
|
|
164
146
|
|
|
165
147
|
> **getAvailableColorPalettes**(): `null` \| `string`[]
|
|
166
148
|
|
|
167
|
-
Defined in: [theme.service.ts:
|
|
149
|
+
Defined in: [theme.service.ts:283](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L283)
|
|
168
150
|
|
|
169
151
|
#### Returns
|
|
170
152
|
|
|
@@ -176,7 +158,7 @@ Defined in: [theme.service.ts:348](https://gitlab.com/rxap/packages/-/blob/15b5f
|
|
|
176
158
|
|
|
177
159
|
> **getAvailableThemes**(): `null` \| `string`[]
|
|
178
160
|
|
|
179
|
-
Defined in: [theme.service.ts:
|
|
161
|
+
Defined in: [theme.service.ts:293](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L293)
|
|
180
162
|
|
|
181
163
|
#### Returns
|
|
182
164
|
|
|
@@ -188,7 +170,7 @@ Defined in: [theme.service.ts:358](https://gitlab.com/rxap/packages/-/blob/15b5f
|
|
|
188
170
|
|
|
189
171
|
> **getAvailableTypographies**(): `null` \| `string`[]
|
|
190
172
|
|
|
191
|
-
Defined in: [theme.service.ts:
|
|
173
|
+
Defined in: [theme.service.ts:303](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L303)
|
|
192
174
|
|
|
193
175
|
#### Returns
|
|
194
176
|
|
|
@@ -200,7 +182,7 @@ Defined in: [theme.service.ts:368](https://gitlab.com/rxap/packages/-/blob/15b5f
|
|
|
200
182
|
|
|
201
183
|
> **getColorPalette**(`colorPaletteName`): `Partial`\<[`ColorPalette`](../wiki/Interface.ColorPalette)\>
|
|
202
184
|
|
|
203
|
-
Defined in: [theme.service.ts:
|
|
185
|
+
Defined in: [theme.service.ts:322](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L322)
|
|
204
186
|
|
|
205
187
|
#### Parameters
|
|
206
188
|
|
|
@@ -218,7 +200,7 @@ Defined in: [theme.service.ts:387](https://gitlab.com/rxap/packages/-/blob/15b5f
|
|
|
218
200
|
|
|
219
201
|
> **getDensity**(): `ThemeDensity`
|
|
220
202
|
|
|
221
|
-
Defined in: [theme.service.ts:
|
|
203
|
+
Defined in: [theme.service.ts:255](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L255)
|
|
222
204
|
|
|
223
205
|
#### Returns
|
|
224
206
|
|
|
@@ -230,7 +212,7 @@ Defined in: [theme.service.ts:320](https://gitlab.com/rxap/packages/-/blob/15b5f
|
|
|
230
212
|
|
|
231
213
|
> **getTheme**(): `string`
|
|
232
214
|
|
|
233
|
-
Defined in: [theme.service.ts:
|
|
215
|
+
Defined in: [theme.service.ts:275](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L275)
|
|
234
216
|
|
|
235
217
|
#### Returns
|
|
236
218
|
|
|
@@ -242,7 +224,7 @@ Defined in: [theme.service.ts:340](https://gitlab.com/rxap/packages/-/blob/15b5f
|
|
|
242
224
|
|
|
243
225
|
> **getTypography**(): `string`
|
|
244
226
|
|
|
245
|
-
Defined in: [theme.service.ts:
|
|
227
|
+
Defined in: [theme.service.ts:266](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L266)
|
|
246
228
|
|
|
247
229
|
#### Returns
|
|
248
230
|
|
|
@@ -254,7 +236,7 @@ Defined in: [theme.service.ts:331](https://gitlab.com/rxap/packages/-/blob/15b5f
|
|
|
254
236
|
|
|
255
237
|
> **restore**(): `void`
|
|
256
238
|
|
|
257
|
-
Defined in: [theme.service.ts:
|
|
239
|
+
Defined in: [theme.service.ts:67](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L67)
|
|
258
240
|
|
|
259
241
|
#### Returns
|
|
260
242
|
|
|
@@ -262,23 +244,11 @@ Defined in: [theme.service.ts:71](https://gitlab.com/rxap/packages/-/blob/15b5fa
|
|
|
262
244
|
|
|
263
245
|
***
|
|
264
246
|
|
|
265
|
-
### restoreDarkMode()
|
|
266
|
-
|
|
267
|
-
> **restoreDarkMode**(): `null` \| `boolean`
|
|
268
|
-
|
|
269
|
-
Defined in: [theme.service.ts:149](https://gitlab.com/rxap/packages/-/blob/15b5fab8912b1042ea325e7f4d98844416018df1/packages/angular/theme/src/lib/theme.service.ts#L149)
|
|
270
|
-
|
|
271
|
-
#### Returns
|
|
272
|
-
|
|
273
|
-
`null` \| `boolean`
|
|
274
|
-
|
|
275
|
-
***
|
|
276
|
-
|
|
277
247
|
### restoreDensity()
|
|
278
248
|
|
|
279
249
|
> **restoreDensity**(): `null` \| `ThemeDensity`
|
|
280
250
|
|
|
281
|
-
Defined in: [theme.service.ts:
|
|
251
|
+
Defined in: [theme.service.ts:140](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L140)
|
|
282
252
|
|
|
283
253
|
#### Returns
|
|
284
254
|
|
|
@@ -290,7 +260,7 @@ Defined in: [theme.service.ts:180](https://gitlab.com/rxap/packages/-/blob/15b5f
|
|
|
290
260
|
|
|
291
261
|
> `protected` **restoreFromPubSub**(): `void`
|
|
292
262
|
|
|
293
|
-
Defined in: [theme.service.ts:
|
|
263
|
+
Defined in: [theme.service.ts:79](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L79)
|
|
294
264
|
|
|
295
265
|
#### Returns
|
|
296
266
|
|
|
@@ -302,7 +272,7 @@ Defined in: [theme.service.ts:92](https://gitlab.com/rxap/packages/-/blob/15b5fa
|
|
|
302
272
|
|
|
303
273
|
> **restoreThemeName**(): `null` \| `string`
|
|
304
274
|
|
|
305
|
-
Defined in: [theme.service.ts:
|
|
275
|
+
Defined in: [theme.service.ts:124](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L124)
|
|
306
276
|
|
|
307
277
|
#### Returns
|
|
308
278
|
|
|
@@ -314,7 +284,7 @@ Defined in: [theme.service.ts:164](https://gitlab.com/rxap/packages/-/blob/15b5f
|
|
|
314
284
|
|
|
315
285
|
> **restoreTypography**(): `null` \| `string`
|
|
316
286
|
|
|
317
|
-
Defined in: [theme.service.ts:
|
|
287
|
+
Defined in: [theme.service.ts:132](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L132)
|
|
318
288
|
|
|
319
289
|
#### Returns
|
|
320
290
|
|
|
@@ -326,7 +296,7 @@ Defined in: [theme.service.ts:172](https://gitlab.com/rxap/packages/-/blob/15b5f
|
|
|
326
296
|
|
|
327
297
|
> **setDarkTheme**(`darkMode`, `silent`, `publish`): `void`
|
|
328
298
|
|
|
329
|
-
Defined in: [theme.service.ts:
|
|
299
|
+
Defined in: [theme.service.ts:160](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L160)
|
|
330
300
|
|
|
331
301
|
#### Parameters
|
|
332
302
|
|
|
@@ -352,7 +322,7 @@ Defined in: [theme.service.ts:200](https://gitlab.com/rxap/packages/-/blob/15b5f
|
|
|
352
322
|
|
|
353
323
|
> **setDensity**(`density`, `silent`, `publish`): `void`
|
|
354
324
|
|
|
355
|
-
Defined in: [theme.service.ts:
|
|
325
|
+
Defined in: [theme.service.ts:164](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L164)
|
|
356
326
|
|
|
357
327
|
#### Parameters
|
|
358
328
|
|
|
@@ -378,7 +348,7 @@ Defined in: [theme.service.ts:213](https://gitlab.com/rxap/packages/-/blob/15b5f
|
|
|
378
348
|
|
|
379
349
|
> **setTheme**(`themeName`, `silent`, `publish`): `void`
|
|
380
350
|
|
|
381
|
-
Defined in: [theme.service.ts:
|
|
351
|
+
Defined in: [theme.service.ts:190](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L190)
|
|
382
352
|
|
|
383
353
|
#### Parameters
|
|
384
354
|
|
|
@@ -404,7 +374,7 @@ Defined in: [theme.service.ts:239](https://gitlab.com/rxap/packages/-/blob/15b5f
|
|
|
404
374
|
|
|
405
375
|
> **setTypography**(`typography`, `silent`, `publish`): `void`
|
|
406
376
|
|
|
407
|
-
Defined in: [theme.service.ts:
|
|
377
|
+
Defined in: [theme.service.ts:177](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L177)
|
|
408
378
|
|
|
409
379
|
#### Parameters
|
|
410
380
|
|
|
@@ -430,7 +400,7 @@ Defined in: [theme.service.ts:226](https://gitlab.com/rxap/packages/-/blob/15b5f
|
|
|
430
400
|
|
|
431
401
|
> **toggleDarkTheme**(): `void`
|
|
432
402
|
|
|
433
|
-
Defined in: [theme.service.ts:
|
|
403
|
+
Defined in: [theme.service.ts:154](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L154)
|
|
434
404
|
|
|
435
405
|
#### Returns
|
|
436
406
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Enumeration: ColorPaletteAlgorithm
|
|
4
4
|
|
|
5
|
-
Defined in: [compute-color-palette.ts:25](https://gitlab.com/rxap/packages/-/blob/
|
|
5
|
+
Defined in: [compute-color-palette.ts:25](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/compute-color-palette.ts#L25)
|
|
6
6
|
|
|
7
7
|
## Enumeration Members
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ Defined in: [compute-color-palette.ts:25](https://gitlab.com/rxap/packages/-/blo
|
|
|
10
10
|
|
|
11
11
|
> **BUCKNER**: `"buckner"`
|
|
12
12
|
|
|
13
|
-
Defined in: [compute-color-palette.ts:27](https://gitlab.com/rxap/packages/-/blob/
|
|
13
|
+
Defined in: [compute-color-palette.ts:27](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/compute-color-palette.ts#L27)
|
|
14
14
|
|
|
15
15
|
***
|
|
16
16
|
|
|
@@ -18,4 +18,4 @@ Defined in: [compute-color-palette.ts:27](https://gitlab.com/rxap/packages/-/blo
|
|
|
18
18
|
|
|
19
19
|
> **CONSTANTIN**: `"constantin"`
|
|
20
20
|
|
|
21
|
-
Defined in: [compute-color-palette.ts:26](https://gitlab.com/rxap/packages/-/blob/
|
|
21
|
+
Defined in: [compute-color-palette.ts:26](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/compute-color-palette.ts#L26)
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **ComputeColorPalette**(`color`, `colorPalette`, `algorithm`?): [`ColorPalette`](../wiki/Interface.ColorPalette)
|
|
6
6
|
|
|
7
|
-
Defined in: [compute-color-palette.ts:30](https://gitlab.com/rxap/packages/-/blob/
|
|
7
|
+
Defined in: [compute-color-palette.ts:30](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/compute-color-palette.ts#L30)
|
|
8
8
|
|
|
9
9
|
## Parameters
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **ObserveCurrentThemeDensity**(): `Observable`\<`ThemeDensity`\>
|
|
6
6
|
|
|
7
|
-
Defined in: [observe-current-theme-density.ts:4](https://gitlab.com/rxap/packages/-/blob/
|
|
7
|
+
Defined in: [observe-current-theme-density.ts:4](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/observe-current-theme-density.ts#L4)
|
|
8
8
|
|
|
9
9
|
## Returns
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
> **provideTheme**(): `EnvironmentProviders`[]
|
|
6
6
|
|
|
7
|
-
Defined in: [provide.ts:7](https://gitlab.com/rxap/packages/-/blob/
|
|
7
|
+
Defined in: [provide.ts:7](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/provide.ts#L7)
|
|
8
8
|
|
|
9
9
|
## Returns
|
|
10
10
|
|
package/docs/wiki/Home.md
CHANGED
|
@@ -8,6 +8,7 @@ This package provides an Angular theme service that allows you to manage and cus
|
|
|
8
8
|

|
|
9
9
|
|
|
10
10
|
- [Installation](../wiki/#installation)
|
|
11
|
+
- [Guides](../wiki/#guides)
|
|
11
12
|
- [Generators](../wiki/#generators)
|
|
12
13
|
- [init](../wiki/#init)
|
|
13
14
|
|
|
@@ -25,6 +26,90 @@ yarn add @angular/cdk @angular/core @rxap/config @rxap/ngx-pub-sub @rxap/rxjs @r
|
|
|
25
26
|
```bash
|
|
26
27
|
yarn nx g @rxap/ngx-theme:init
|
|
27
28
|
```
|
|
29
|
+
# Guides
|
|
30
|
+
|
|
31
|
+
# Dark and Light mode with tailwind and angular material 3
|
|
32
|
+
|
|
33
|
+
This guide provides the setup steps for configuring Tailwind CSS and Angular Material for the light/dark/system theme switching mechanism, using the approaches we discussed previously.
|
|
34
|
+
|
|
35
|
+
## 1. Configure Tailwind with the Variant Strategy
|
|
36
|
+
|
|
37
|
+
Update your tailwind.config.js to use the variant strategy. This allows Tailwind to react to both the system preference (prefers-color-scheme) and specific classes (.light, .dark) for manual overrides.
|
|
38
|
+
|
|
39
|
+
```js
|
|
40
|
+
// tailwind.config.js
|
|
41
|
+
/** @type {import('tailwindcss').Config} */
|
|
42
|
+
module.exports = {
|
|
43
|
+
// ... other configurations
|
|
44
|
+
darkMode: 'selector',
|
|
45
|
+
theme: {
|
|
46
|
+
extend: {
|
|
47
|
+
// ... your theme extensions
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
plugins: [],
|
|
51
|
+
// ...
|
|
52
|
+
};
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
This configuration tells Tailwind to apply dark: variants if EITHER the system preference is dark (and not overridden by .light) OR if the .dark class is explicitly set on an ancestor element.
|
|
56
|
+
|
|
57
|
+
## 2. Integrate with Angular Material (Modern MDC Approach)
|
|
58
|
+
|
|
59
|
+
Use the modern Angular Material Sass API (mat.theme) to define your theme once and emit CSS variables. Then, use CSS to control the color-scheme property based on the .light and .dark classes applied by the ThemeService. Material components will react automatically to the computed color-scheme.
|
|
60
|
+
|
|
61
|
+
```scss
|
|
62
|
+
@use '@angular/material' as mat;
|
|
63
|
+
|
|
64
|
+
html {
|
|
65
|
+
@include mat.theme((
|
|
66
|
+
color: mat.$violet-palette,
|
|
67
|
+
typography: Roboto,
|
|
68
|
+
density: 0
|
|
69
|
+
));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// --- Tailwind Integration ---
|
|
73
|
+
@tailwind base;
|
|
74
|
+
@tailwind components;
|
|
75
|
+
@tailwind utilities;
|
|
76
|
+
|
|
77
|
+
// --- Color Scheme Control & Base Styles ---
|
|
78
|
+
html { // Setting on html or :root is fine
|
|
79
|
+
// Default: Let the browser choose light/dark based on system preference.
|
|
80
|
+
// Material components & Tailwind's media query variant will react to this.
|
|
81
|
+
color-scheme: light dark;
|
|
82
|
+
|
|
83
|
+
// Apply base background/text colors (Tailwind handles dark via variants).
|
|
84
|
+
// Add transitions for smoother switching.
|
|
85
|
+
@apply bg-white text-gray-800 transition-colors duration-200 ease-in-out;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Force light mode when .light class is present on an ancestor (e.g., body)
|
|
89
|
+
// Use :where to keep specificity low, preventing conflicts.
|
|
90
|
+
:where(html.light, body.light, .light) {
|
|
91
|
+
color-scheme: light;
|
|
92
|
+
// Ensure light background/text if overriding system dark mode
|
|
93
|
+
@apply bg-white text-gray-800;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Force dark mode when .dark class is present on an ancestor (e.g., body)
|
|
97
|
+
// Use :where to keep specificity low.
|
|
98
|
+
:where(html.dark, body.dark, .dark) {
|
|
99
|
+
color-scheme: dark;
|
|
100
|
+
// Apply dark background/text (complements Tailwind's dark: variants)
|
|
101
|
+
@apply bg-gray-900 text-gray-200;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Other global styles can go here
|
|
105
|
+
body {
|
|
106
|
+
// Ensure body takes full height if needed, etc.
|
|
107
|
+
@apply min-h-screen m-0; // Added margin reset
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
This setup provides the configuration for Tailwind and the recommended SCSS structure for Angular Material theming that integrates with the ThemeService managing the .light and .dark classes.
|
|
112
|
+
|
|
28
113
|
# Generators
|
|
29
114
|
|
|
30
115
|
## init
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: ColorPalette
|
|
4
4
|
|
|
5
|
-
Defined in: [compute-color-palette.ts:8](https://gitlab.com/rxap/packages/-/blob/
|
|
5
|
+
Defined in: [compute-color-palette.ts:8](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/compute-color-palette.ts#L8)
|
|
6
6
|
|
|
7
7
|
## Properties
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ Defined in: [compute-color-palette.ts:8](https://gitlab.com/rxap/packages/-/blob
|
|
|
10
10
|
|
|
11
11
|
> **100**: `string`
|
|
12
12
|
|
|
13
|
-
Defined in: [compute-color-palette.ts:10](https://gitlab.com/rxap/packages/-/blob/
|
|
13
|
+
Defined in: [compute-color-palette.ts:10](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/compute-color-palette.ts#L10)
|
|
14
14
|
|
|
15
15
|
***
|
|
16
16
|
|
|
@@ -18,7 +18,7 @@ Defined in: [compute-color-palette.ts:10](https://gitlab.com/rxap/packages/-/blo
|
|
|
18
18
|
|
|
19
19
|
> **200**: `string`
|
|
20
20
|
|
|
21
|
-
Defined in: [compute-color-palette.ts:11](https://gitlab.com/rxap/packages/-/blob/
|
|
21
|
+
Defined in: [compute-color-palette.ts:11](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/compute-color-palette.ts#L11)
|
|
22
22
|
|
|
23
23
|
***
|
|
24
24
|
|
|
@@ -26,7 +26,7 @@ Defined in: [compute-color-palette.ts:11](https://gitlab.com/rxap/packages/-/blo
|
|
|
26
26
|
|
|
27
27
|
> **300**: `string`
|
|
28
28
|
|
|
29
|
-
Defined in: [compute-color-palette.ts:12](https://gitlab.com/rxap/packages/-/blob/
|
|
29
|
+
Defined in: [compute-color-palette.ts:12](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/compute-color-palette.ts#L12)
|
|
30
30
|
|
|
31
31
|
***
|
|
32
32
|
|
|
@@ -34,7 +34,7 @@ Defined in: [compute-color-palette.ts:12](https://gitlab.com/rxap/packages/-/blo
|
|
|
34
34
|
|
|
35
35
|
> **400**: `string`
|
|
36
36
|
|
|
37
|
-
Defined in: [compute-color-palette.ts:13](https://gitlab.com/rxap/packages/-/blob/
|
|
37
|
+
Defined in: [compute-color-palette.ts:13](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/compute-color-palette.ts#L13)
|
|
38
38
|
|
|
39
39
|
***
|
|
40
40
|
|
|
@@ -42,7 +42,7 @@ Defined in: [compute-color-palette.ts:13](https://gitlab.com/rxap/packages/-/blo
|
|
|
42
42
|
|
|
43
43
|
> **50**: `string`
|
|
44
44
|
|
|
45
|
-
Defined in: [compute-color-palette.ts:9](https://gitlab.com/rxap/packages/-/blob/
|
|
45
|
+
Defined in: [compute-color-palette.ts:9](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/compute-color-palette.ts#L9)
|
|
46
46
|
|
|
47
47
|
***
|
|
48
48
|
|
|
@@ -50,7 +50,7 @@ Defined in: [compute-color-palette.ts:9](https://gitlab.com/rxap/packages/-/blob
|
|
|
50
50
|
|
|
51
51
|
> **500**: `string`
|
|
52
52
|
|
|
53
|
-
Defined in: [compute-color-palette.ts:14](https://gitlab.com/rxap/packages/-/blob/
|
|
53
|
+
Defined in: [compute-color-palette.ts:14](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/compute-color-palette.ts#L14)
|
|
54
54
|
|
|
55
55
|
***
|
|
56
56
|
|
|
@@ -58,7 +58,7 @@ Defined in: [compute-color-palette.ts:14](https://gitlab.com/rxap/packages/-/blo
|
|
|
58
58
|
|
|
59
59
|
> **600**: `string`
|
|
60
60
|
|
|
61
|
-
Defined in: [compute-color-palette.ts:15](https://gitlab.com/rxap/packages/-/blob/
|
|
61
|
+
Defined in: [compute-color-palette.ts:15](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/compute-color-palette.ts#L15)
|
|
62
62
|
|
|
63
63
|
***
|
|
64
64
|
|
|
@@ -66,7 +66,7 @@ Defined in: [compute-color-palette.ts:15](https://gitlab.com/rxap/packages/-/blo
|
|
|
66
66
|
|
|
67
67
|
> **700**: `string`
|
|
68
68
|
|
|
69
|
-
Defined in: [compute-color-palette.ts:16](https://gitlab.com/rxap/packages/-/blob/
|
|
69
|
+
Defined in: [compute-color-palette.ts:16](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/compute-color-palette.ts#L16)
|
|
70
70
|
|
|
71
71
|
***
|
|
72
72
|
|
|
@@ -74,7 +74,7 @@ Defined in: [compute-color-palette.ts:16](https://gitlab.com/rxap/packages/-/blo
|
|
|
74
74
|
|
|
75
75
|
> **800**: `string`
|
|
76
76
|
|
|
77
|
-
Defined in: [compute-color-palette.ts:17](https://gitlab.com/rxap/packages/-/blob/
|
|
77
|
+
Defined in: [compute-color-palette.ts:17](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/compute-color-palette.ts#L17)
|
|
78
78
|
|
|
79
79
|
***
|
|
80
80
|
|
|
@@ -82,7 +82,7 @@ Defined in: [compute-color-palette.ts:17](https://gitlab.com/rxap/packages/-/blo
|
|
|
82
82
|
|
|
83
83
|
> **900**: `string`
|
|
84
84
|
|
|
85
|
-
Defined in: [compute-color-palette.ts:18](https://gitlab.com/rxap/packages/-/blob/
|
|
85
|
+
Defined in: [compute-color-palette.ts:18](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/compute-color-palette.ts#L18)
|
|
86
86
|
|
|
87
87
|
***
|
|
88
88
|
|
|
@@ -90,7 +90,7 @@ Defined in: [compute-color-palette.ts:18](https://gitlab.com/rxap/packages/-/blo
|
|
|
90
90
|
|
|
91
91
|
> **A100**: `string`
|
|
92
92
|
|
|
93
|
-
Defined in: [compute-color-palette.ts:19](https://gitlab.com/rxap/packages/-/blob/
|
|
93
|
+
Defined in: [compute-color-palette.ts:19](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/compute-color-palette.ts#L19)
|
|
94
94
|
|
|
95
95
|
***
|
|
96
96
|
|
|
@@ -98,7 +98,7 @@ Defined in: [compute-color-palette.ts:19](https://gitlab.com/rxap/packages/-/blo
|
|
|
98
98
|
|
|
99
99
|
> **A200**: `string`
|
|
100
100
|
|
|
101
|
-
Defined in: [compute-color-palette.ts:20](https://gitlab.com/rxap/packages/-/blob/
|
|
101
|
+
Defined in: [compute-color-palette.ts:20](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/compute-color-palette.ts#L20)
|
|
102
102
|
|
|
103
103
|
***
|
|
104
104
|
|
|
@@ -106,7 +106,7 @@ Defined in: [compute-color-palette.ts:20](https://gitlab.com/rxap/packages/-/blo
|
|
|
106
106
|
|
|
107
107
|
> **A400**: `string`
|
|
108
108
|
|
|
109
|
-
Defined in: [compute-color-palette.ts:21](https://gitlab.com/rxap/packages/-/blob/
|
|
109
|
+
Defined in: [compute-color-palette.ts:21](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/compute-color-palette.ts#L21)
|
|
110
110
|
|
|
111
111
|
***
|
|
112
112
|
|
|
@@ -114,4 +114,4 @@ Defined in: [compute-color-palette.ts:21](https://gitlab.com/rxap/packages/-/blo
|
|
|
114
114
|
|
|
115
115
|
> **A700**: `string`
|
|
116
116
|
|
|
117
|
-
Defined in: [compute-color-palette.ts:22](https://gitlab.com/rxap/packages/-/blob/
|
|
117
|
+
Defined in: [compute-color-palette.ts:22](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/compute-color-palette.ts#L22)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: ColorPaletteConfig
|
|
4
4
|
|
|
5
|
-
Defined in: [theme.service.ts:
|
|
5
|
+
Defined in: [theme.service.ts:40](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L40)
|
|
6
6
|
|
|
7
7
|
## Extended by
|
|
8
8
|
|
|
@@ -14,7 +14,7 @@ Defined in: [theme.service.ts:39](https://gitlab.com/rxap/packages/-/blob/15b5fa
|
|
|
14
14
|
|
|
15
15
|
> `optional` **algorithm**: `string`
|
|
16
16
|
|
|
17
|
-
Defined in: [theme.service.ts:
|
|
17
|
+
Defined in: [theme.service.ts:41](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L41)
|
|
18
18
|
|
|
19
19
|
***
|
|
20
20
|
|
|
@@ -22,7 +22,7 @@ Defined in: [theme.service.ts:40](https://gitlab.com/rxap/packages/-/blob/15b5fa
|
|
|
22
22
|
|
|
23
23
|
> `optional` **base**: `string`
|
|
24
24
|
|
|
25
|
-
Defined in: [theme.service.ts:
|
|
25
|
+
Defined in: [theme.service.ts:42](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L42)
|
|
26
26
|
|
|
27
27
|
***
|
|
28
28
|
|
|
@@ -30,4 +30,4 @@ Defined in: [theme.service.ts:41](https://gitlab.com/rxap/packages/-/blob/15b5fa
|
|
|
30
30
|
|
|
31
31
|
> `optional` **color**: `Partial`\<[`ColorPalette`](../wiki/Interface.ColorPalette)\>
|
|
32
32
|
|
|
33
|
-
Defined in: [theme.service.ts:
|
|
33
|
+
Defined in: [theme.service.ts:43](https://gitlab.com/rxap/packages/-/blob/b32f110144dafee760d535d217a2855e77f154a5/packages/angular/theme/src/lib/theme.service.ts#L43)
|