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)