Creating themes


Is there a straightfoward way to create toggleable themes in an electron and react app?


Use Bootstrap, Semantic UI, Foundation or any other front-end framework, there are plenty of themes available for either. If you’re looking for an example – some years ago (aka I’d do it differently today) I used Bootstrap with a theme selector on this page.


No, I’m referring to the ability to create a set of css rules and toggle on command.

For example, think of a day/night theme.

My first thought would be to just have a state in every component indicating the current theme, and then toggling that state when needed. This of course seems overly complex having to implement it into every component separately.


That’s exactly why I suggested an established framework with an ecosystem of hundreds of themes to choose from.

For example, Bootswatch is a popular series of Bootstrap-compatible themes and with Flatly and Darkly and it has two complementary styles for day and night mode.