← Back to context

Comment by austincheney

5 years ago

This approach, if you tried it, is just a one time copy/paste to impose an entire theme change, such as swapping CSS files.

There isn't a cross-browser one step way to swap CSS files on live pages that I am aware of, especially if CSP is enabled as is the case with HN.

Open DevTools. Go to Sources. Click news.css. Paste in your own CSS.

  • Still not a one step solution and its a bit different cross browser. Its not a one step solution because you have to either modify an identifier in the page to support another additional template or completely throw the default colors away so that the new colors replace the default colors.

    The little one line JavaScript code is literally copy/paste which allows for moving between pages and page refreshes and pressing up arrow then enter on the keyboard to reapply the theme change without manually reapplying a new stylesheet and/or modifying the DOM each time.