I'm developing a new WordPress theme and I'm at the point where I'm adding theme customizer options. Most of them have been surprisingly easy to implement, but I'm stumped on a couple of important options:
- Switching between a light and dark theme
- Switching between two web font choices
I understand how to properly enqueue stylesheets and scripts and I'm getting pretty familiar with how to add settings, sections and controls to the Theme Customizer. What I need now is a way to conditionally load stylesheets (the light/dark skins) and scripts (the web fonts).
How can I do something like this?
// if the skin is set to 'light' // enqueue light.css // if the skin is set to 'dark' // enqueue dark.css
// if the font style is set to 'sans-serif' // enqueue source-sans-pro; // if the font-style is set to 'serif' // enqueue merriweather;