Skip to content

Fireship CSS theme toggler fork where I resolved some of the most common issues with themes behaviour and caching in the local storage.

Notifications You must be signed in to change notification settings

kr4chinin/css-theme-toggler-fork

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Light 🏙 - Dark 🌌 - Solar 🌇 Mode Theme Toggler

In this version of css theme toggler app I've resolved these problems:

  • Initial light class is now being added to the body programmatically. In the Fireship's version after page reload you could notice that body deriving preffered theme from the local storage and adding it to the already exsisiting one which is hardcoded light theme (so, if preferred theme was dark then after the page reload you will see <body class="light dark">.
  • In initial version of this app if you choose solarized theme — solarizeButton acquires normalize innerText property. But when page is reloaded it loses its value although the theme is still solarized. Now it will keep it.
  • Dropdown was accessible via page inspector and dev tools even when it was hidden. I've changed its z-index property so now it is truly unreachable when hidden.
  • Removed unnecessary pointer-events: auto; property because its implicitly has necessary value.

About

Fireship CSS theme toggler fork where I resolved some of the most common issues with themes behaviour and caching in the local storage.

Topics

Resources

Stars

Watchers

Forks

Languages

  • HTML 42.9%
  • CSS 39.8%
  • JavaScript 17.3%