Open mruknowme opened 1 month ago
Hello there, Is that still the case on the 1.0.0 ? :)
Hi @MGREMY,
thanks for your response. Looks like v1 is a major update with many breaking changes. Looks like in v1:
ThemeService.$theme
available and instead ThemeService.getClasses
?could you please point me in the right direction regarding how to implement theme switching (dark/light) in v1?
Thanks
To clarify the comment above, what I'd like to know is how to 'subscribe' to theme changes so I can update another third-party component (AgGrid) based on the current theme.
Hey
We will have some adjustments to make of dark/light theme, but if you want to add dark/light theme into your application, you just have to add somewhere the DarkThemeToggleComponent
; then when you click on it it will set (or reset) color-theme
inside localStorage and add the class dark
to the html tag
That's how TailwindCSS works
To clarify the comment above, what I'd like to know is how to 'subscribe' to theme changes so I can update another third-party component (AgGrid) based on the current theme.
For now we don't provide a way to subscribe or get the signal of the current theme It will come soon tho
For now, one solution could be to subscribe to the localStorage's color-theme
value, and then update the third party component :)
Ok, thank you @MGREMY , will use localStorage for now. Will be waiting for the 'official' way Service/Observable/Signal.
ThemeService.$theme doesn't update when the theme is switched using the switcher component.