분명히 야간 모드에서 잘 작동해서 코드 복사해서 else 뒤에 있는 주간 모드에 붙여 넣기해서 색깔만 바꿔서 브라우저에서 해보니 주간/야간 모드가 작동하질 않았다. 한 5분 정도 헤매다가 발견한 문제의 원인은 바로 코드를 복사할 때 닫는 중괄호( } )까지 복사하지 않아서 작동하질 않았던 거였다. 하하하.
The NodeList object returned by the querySelectorAll() method must be static, not live ([DOM-LEVEL-3-CORE], section 1.1.1). Subsequent changes to the structure of the underlying document must not be reflected in the NodeList object. This means that the object will instead contain a list of matching Element nodes that were in the document at the time the list was created.