-
-
Notifications
You must be signed in to change notification settings - Fork 96
Theme Management
As of v0.1.4 the theme consists of only two parts that needed to be changed.
- Background Color
- Text Color
So, I've used CSS variables to achieve this. In main.scss file here here the specified variables that would further change.
In the theme.js all the themes are to be specified with background color and text color.
The script.js file contains all the logic that needs to be added.
onLoad() method iterates through the themeMap from script.js
and adds options
to the [selector](https://github.com/rohitjain00/dev-portfolio-blog/blob/master/_includes/themeSelector.html)
.
The toggleTheme() method runs when the selector's
value changes and the current theme and the element to apply on is provided to the changeTheme()
method.
This changes the CSS variables and the themes are changes.