Skip to content

Theme Preference Toggle, an ease tool made of HTML, CSS and vanilla Javascript to configure the color scheme preference on a website.

License

Notifications You must be signed in to change notification settings

feguino/theme-preference-toggle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Building a theme switch component

A website may provide settings for controlling the color scheme instead of relying entirely on the system preference. This means that users may browse in a mode other than their system preferences. For example, a user's system is in a light theme, but the user prefers the website to display in the dark theme.

There are several web engineering considerations when building this feature. For example, the browser should be made aware of the preference as soon as possible to prevent page color flashes, and the control needs to first sync with the system then allow client-side stored exceptions.

💻Live Preview

image

About

Theme Preference Toggle, an ease tool made of HTML, CSS and vanilla Javascript to configure the color scheme preference on a website.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published