in πŸ’¬ Microblog Β· design javascript optimization

This post is over 1 year old. Facts and opinions may have changed since the publication date. Contact me for any clarifications before jumping into any conclusions.

Just fixed the flickering issue by inlining the required JavaScript, which is a really small snippet. If you’re curious about the code I’m using to toggle between the dark and light themes, following the user’s choice and falling back to the OS settings, here it is:

const mql = window.matchMedia('(prefers-color-scheme: dark)');

function toggleT (to) {
  localStorage.setItem('t', to);

function theme (query) {
  const userOption = localStorage.getItem('t'); = userOption === null
    ? (query.matches ? 'dark' : '')
    : (userOption === 'd' ? 'dark' : '');


Or if you don't know what a response is, you can always write a webmention comment (you don't need to know what that is).