• fd93@programming.dev
      link
      fedilink
      arrow-up
      2
      ·
      2 years ago

      Hey - the poster isn’t actually the author. That would be me! Thanks for the feedback though. I normally just use Dark Reader for switching theme.

    • qaz@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      2 years ago

      It did nothing when clicking it the first time and only changed the second time I clicked it

      • snowe@programming.devM
        link
        fedilink
        arrow-up
        1
        ·
        2 years ago

        I’ve wondered what this problem was for years but never cared to figure it out, because it always resolved after the first button press (just refresh the page and it all works properly). turns out it is something wrong with my use of local storage to save your theme state. if you don’t have the key in local storage then it does what you mentioned. I just need to switch this to prefers-color-scheme anyway.

    • jadero@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      2 years ago

      There was a thread elsewhere asking whether a toggle should show current state or the state desired. There was enough disagreement that it quickly became apparent that, whatever else the toggle does, there should be something external to the toggle showing the possible states, indicating which way to move the toggle regardless of toggle appearance.