donavon / use-dark-mode

A custom React Hook to help you implement a "dark mode" component.
MIT License
1.28k stars 100 forks source link

Work on all stylesheets #67

Open Saakshaat opened 3 years ago

Saakshaat commented 3 years ago

[FEATURE REQUEST]

It seems like, currently, this hook only works with global styles sheets but as the codebase grows, multiple stylesheets become a necessity. This is particularly relevant with frameworks like Next.js where the file structure advises different stylesheets for different modules, separate from the global stylesheet.

I think it'll be really valuable if this worked with all stylesheets and not just global. Since the useDarkMode function looks for classes name .dark-mode or .light-mode (or other user-defined names) could this hook be used to also implemented these classes present in other stylesheets?