Showing posts tagged with "JavaScript"

How to add a theme selection feature with vanilla JavaScript

Aug 26, 2022

In the previous post, I explained how to automatically set a dark theme using a CSS media query to check site visitors’ device preferences. Next, I will show you how to let users select the site theme by writing a few JavaScript functions.

Continue Reading »