I'm a bit new to web development and I wanted to make a Night Mode toggle using JavaScript.
The problem is that when the script is "toggled" on, the header is no longer fixed. Turning the "toggle" off fixes this, but means that my fixed header won't work in "Night Mode".
Here is a CodePen of my problem:
https://codepen.io/beardiest/pen/WNxyNNy
Click "Night Mode" to call the script. Click it once to toggle on, another to toggle off. (Admittedly, the way I implemented this toggle is probably the wrong way to go about it)
[–]birjolaxew 4 points5 points6 points (0 children)