Closed asabadyr closed 2 years ago
@tulup-conner would be the solution for it similar to #244? What do you think?
IMHO, we need to start to export the context functions to allow users to access it. Maybe the cases are similar, but not the same...
PS: I changed my mind about the export of the context. I don't think that it is really necessary.
I don't see a reason not to export them.
Once the ThemeContext exported, theme can be customised?
@zhex900 you don't need the ThemeContext
to customize the theme. All that you need is to create your own theme, based on FlowbiteTheme
and use it:
<Flowbite theme={yourTheme}>
<App />
</Flowbite>
Hi team, any news on this? Thanks
I was thinking about this one and I do have an extra question here @asabadyr:
Since the ThemeContext also adds to the <html>
the class="dark"
property, can't you use it to customize the style of the charts?
I was thinking about this one and I do have an extra question here @asabadyr:
Since the ThemeContext also adds to the
<html>
theclass="dark"
property, can't you use it to customize the style of the charts?
It's possible to do a number of ways even reading from localStorage. but when user switches to dark/light mode the tree of components is not re-rendered. in fact I have no way to listen to the event of mode change. Another option would be to add a callback to the mode switch component to be able to react to this switch.
Is your feature request related to a problem? Please describe. Using third party components (nivo.rocks). Need to adapt text color in charts according to the dark/light mode. The best option would be getting access to the ThemeContext that is used internally in Flowbite.
Describe the solution you'd like export ThemeContext to be able to use in components
Describe alternatives you've considered useEffect with a window storage listener to get 'theme' value doesn't work