Creating themes


#1

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


#2

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.


#3

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.


#4

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.