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 normalizeinnerText
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.