I'm new to JavaScript and Node.js and I'm trying to learn enough to be able to make an app with Electron. One thing I really want my app to feature is the ability for the user to define custom colors for the app so it can be themed to their liking.
What is the best way to go about this? What I'm thinking is to make each theme the user creates get saved as a JSON file containing a few named color values which will be the theme's colors. It would look something like this:
{
color_hex_main: "#ffffff",
color_hex_secondary: "#222222",
.
.
.
color_hex_button: "#333333"
}
How can I load the colors defined in this file into the CSS and therefore the HTML at the click of a button which resides on the page being themed? Of course, I'm assuming that the way to do this is to somehow modify the CSS which styles the page. If this is indeed what I'm supposed to do, how do I do this, and if it's not, what do I do instead?
via Aaron Beaudoin
No comments:
Post a Comment