@rxap/ngx-theme 19.0.4-dev.0 → 19.1.0-dev.1

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.
Files changed (89) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +86 -1
  3. package/compodoc/changelog.html +10 -0
  4. package/compodoc/classes/ThemeColor.html +874 -0
  5. package/compodoc/dependencies.html +6 -4
  6. package/compodoc/index.html +70 -2
  7. package/compodoc/injectables/ThemeModeService.html +1256 -0
  8. package/compodoc/injectables/ThemeService.html +82 -265
  9. package/compodoc/interfaces/BasePalette.html +844 -0
  10. package/compodoc/interfaces/ColorPaletteConfig.html +6 -71
  11. package/compodoc/interfaces/ColorPaletteConfigWithName.html +6 -71
  12. package/compodoc/interfaces/ThemeColors.html +898 -0
  13. package/compodoc/interfaces/ThemeConfig.html +6 -71
  14. package/compodoc/js/menu-wc.js +25 -0
  15. package/compodoc/js/menu-wc_es5.js +1 -1
  16. package/compodoc/js/search/search_index.js +2 -2
  17. package/compodoc/miscellaneous/functions.html +60 -1
  18. package/compodoc/miscellaneous/typealiases.html +364 -0
  19. package/compodoc/miscellaneous/variables.html +193 -0
  20. package/compodoc/overview.html +10 -2
  21. package/compodoc/properties.html +1 -1
  22. package/docs/documentation.json +2294 -530
  23. package/docs/html/assets/hierarchy.js +1 -1
  24. package/docs/html/assets/highlight.css +28 -0
  25. package/docs/html/assets/navigation.js +1 -1
  26. package/docs/html/assets/search.js +1 -1
  27. package/docs/html/classes/ThemeColor.html +4 -0
  28. package/docs/html/classes/ThemeModeService.html +35 -0
  29. package/docs/html/classes/ThemeService.html +4 -6
  30. package/docs/html/enums/ColorPaletteAlgorithm.html +2 -2
  31. package/docs/html/functions/ComputeColorPalette.html +1 -1
  32. package/docs/html/functions/ObserveCurrentThemeDensity.html +1 -1
  33. package/docs/html/functions/applyThemeColorBootstrapHook.html +1 -0
  34. package/docs/html/functions/provideTheme.html +1 -1
  35. package/docs/html/hierarchy.html +1 -1
  36. package/docs/html/index.html +61 -3
  37. package/docs/html/interfaces/ColorPalette.html +2 -2
  38. package/docs/html/interfaces/ColorPaletteConfig.html +2 -2
  39. package/docs/html/interfaces/ColorPaletteConfigWithName.html +2 -2
  40. package/docs/html/interfaces/ThemeColors.html +7 -0
  41. package/docs/html/interfaces/ThemeConfig.html +2 -2
  42. package/docs/html/modules.html +1 -1
  43. package/docs/html/types/ActiveTheme.html +1 -0
  44. package/docs/html/types/ThemeSetting.html +1 -0
  45. package/docs/html/variables/THEME_SETTING_KEY.html +1 -0
  46. package/docs/markdown/README.md +87 -2
  47. package/docs/markdown/classes/ThemeColor.md +83 -0
  48. package/docs/markdown/classes/ThemeModeService.md +282 -0
  49. package/docs/markdown/classes/ThemeService.md +39 -69
  50. package/docs/markdown/enumerations/ColorPaletteAlgorithm.md +4 -4
  51. package/docs/markdown/functions/ComputeColorPalette.md +2 -2
  52. package/docs/markdown/functions/ObserveCurrentThemeDensity.md +2 -2
  53. package/docs/markdown/functions/applyThemeColorBootstrapHook.md +31 -0
  54. package/docs/markdown/functions/provideTheme.md +2 -2
  55. package/docs/markdown/globals.md +15 -2
  56. package/docs/markdown/interfaces/ColorPalette.md +16 -16
  57. package/docs/markdown/interfaces/ColorPaletteConfig.md +5 -5
  58. package/docs/markdown/interfaces/ColorPaletteConfigWithName.md +6 -6
  59. package/docs/markdown/interfaces/ThemeColors.md +57 -0
  60. package/docs/markdown/interfaces/ThemeConfig.md +7 -7
  61. package/docs/markdown/type-aliases/ActiveTheme.md +11 -0
  62. package/docs/markdown/type-aliases/ThemeSetting.md +11 -0
  63. package/docs/markdown/variables/THEME_SETTING_KEY.md +11 -0
  64. package/docs/wiki/Class.ThemeColor.md +79 -0
  65. package/docs/wiki/Class.ThemeModeService.md +278 -0
  66. package/docs/wiki/Class.ThemeService.md +38 -68
  67. package/docs/wiki/Enumeration.ColorPaletteAlgorithm.md +3 -3
  68. package/docs/wiki/Function.ComputeColorPalette.md +1 -1
  69. package/docs/wiki/Function.ObserveCurrentThemeDensity.md +1 -1
  70. package/docs/wiki/Function.applyThemeColorBootstrapHook.md +27 -0
  71. package/docs/wiki/Function.provideTheme.md +1 -1
  72. package/docs/wiki/Home.md +86 -1
  73. package/docs/wiki/Interface.ColorPalette.md +15 -15
  74. package/docs/wiki/Interface.ColorPaletteConfig.md +4 -4
  75. package/docs/wiki/Interface.ColorPaletteConfigWithName.md +5 -5
  76. package/docs/wiki/Interface.ThemeColors.md +53 -0
  77. package/docs/wiki/Interface.ThemeConfig.md +6 -6
  78. package/docs/wiki/TypeAlias.ActiveTheme.md +7 -0
  79. package/docs/wiki/TypeAlias.ThemeSetting.md +7 -0
  80. package/docs/wiki/Variable.THEME_SETTING_KEY.md +7 -0
  81. package/docs/wiki/_Sidebar.md +13 -0
  82. package/docs/wiki/globals.md +14 -1
  83. package/fesm2022/rxap-ngx-theme.mjs +392 -61
  84. package/fesm2022/rxap-ngx-theme.mjs.map +1 -1
  85. package/index.d.ts +2 -0
  86. package/lib/theme-color.d.ts +29 -0
  87. package/lib/theme-mode.service.d.ts +61 -0
  88. package/lib/theme.service.d.ts +3 -5
  89. package/package.json +13 -12
package/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [19.1.0-dev.1](https://gitlab.com/rxap/packages/compare/@rxap/ngx-theme@19.1.0-dev.0...@rxap/ngx-theme@19.1.0-dev.1) (2025-05-06)
7
+
8
+ ### Features
9
+
10
+ - **theme:** add ThemeColor class for managing Material Design color themes ([e01a74b](https://gitlab.com/rxap/packages/commit/e01a74bd47c9690383311db6d7a7298919c3fc66))
11
+
12
+ # [19.1.0-dev.0](https://gitlab.com/rxap/packages/compare/@rxap/ngx-theme@19.0.4-dev.0...@rxap/ngx-theme@19.1.0-dev.0) (2025-04-02)
13
+
14
+ ### Features
15
+
16
+ - **theme:** implement theme mode service for dynamic light/dark mode switching ([702a6db](https://gitlab.com/rxap/packages/commit/702a6db291f352ece63c937e7540a5a74469ff84))
17
+
6
18
  ## [19.0.4-dev.0](https://gitlab.com/rxap/packages/compare/@rxap/ngx-theme@19.0.3...@rxap/ngx-theme@19.0.4-dev.0) (2025-03-12)
7
19
 
8
20
  **Note:** Version bump only for package @rxap/ngx-theme
package/README.md CHANGED
@@ -8,6 +8,7 @@ This package provides an Angular theme service that allows you to manage and cus
8
8
  ![NPM](https://img.shields.io/npm/l/@rxap/ngx-theme)
9
9
 
10
10
  - [Installation](#installation)
11
+ - [Guides](#guides)
11
12
  - [Generators](#generators)
12
13
  - [init](#init)
13
14
 
@@ -19,12 +20,96 @@ yarn add @rxap/ngx-theme
19
20
  ```
20
21
  **Install peer dependencies:**
21
22
  ```bash
22
- yarn add @angular/cdk @angular/core @rxap/config @rxap/ngx-pub-sub @rxap/rxjs @rxap/utilities rxjs
23
+ yarn add @angular/cdk @angular/core @material/material-color-utilities @rxap/config @rxap/ngx-pub-sub @rxap/rxjs @rxap/utilities rxjs
23
24
  ```
24
25
  **Execute the init generator:**
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
@@ -85,6 +85,16 @@
85
85
  <h1>Change Log</h1>
86
86
  <p>All notable changes to this project will be documented in this file.
87
87
  See <a href="https://conventionalcommits.org">Conventional Commits</a> for commit guidelines.</p>
88
+ <h1><a href="https://gitlab.com/rxap/packages/compare/@rxap/ngx-theme@19.1.0-dev.0...@rxap/ngx-theme@19.1.0-dev.1">19.1.0-dev.1</a> (2025-05-06)</h1>
89
+ <h3>Features</h3>
90
+ <ul>
91
+ <li><strong>theme:</strong> add ThemeColor class for managing Material Design color themes (<a href="https://gitlab.com/rxap/packages/commit/e01a74bd47c9690383311db6d7a7298919c3fc66">e01a74b</a>)</li>
92
+ </ul>
93
+ <h1><a href="https://gitlab.com/rxap/packages/compare/@rxap/ngx-theme@19.0.4-dev.0...@rxap/ngx-theme@19.1.0-dev.0">19.1.0-dev.0</a> (2025-04-02)</h1>
94
+ <h3>Features</h3>
95
+ <ul>
96
+ <li><strong>theme:</strong> implement theme mode service for dynamic light/dark mode switching (<a href="https://gitlab.com/rxap/packages/commit/702a6db291f352ece63c937e7540a5a74469ff84">702a6db</a>)</li>
97
+ </ul>
88
98
  <h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/ngx-theme@19.0.3...@rxap/ngx-theme@19.0.4-dev.0">19.0.4-dev.0</a> (2025-03-12)</h2>
89
99
  <p><strong>Note:</strong> Version bump only for package @rxap/ngx-theme</p>
90
100
  <h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/ngx-theme@19.0.3-dev.1...@rxap/ngx-theme@19.0.3">19.0.3</a> (2025-03-07)</h2>