Adding a light and dark mode with a toggle or switch

Поділитися
Вставка
  • Опубліковано 31 жов 2024

КОМЕНТАРІ • 3

  • @NoScriptShow
    @NoScriptShow  6 місяців тому

    Code and link are here: noscript.show/learn/9

  • @theodorealenas3171
    @theodorealenas3171 6 місяців тому +1

    I also found it annoying that there has to be Javascript, plus to consider the user preference if nothing gets pressed, the Javascript doubles in size. Thankfully, I managed to keep it at about 15-20 lines, if I recall.
    The bad thing is that I had to not use media queries, so I'm not helping media queries evolve.

    • @DavidWaumsley
      @DavidWaumsley 6 місяців тому

      Nice to hear from you again and also hear you share the same frustration. I think Bramus might be right that this toggle should be a part of browsers. No doubt that would have it's own issues, but as you point out, it might encourage more to use these new media queries and offer these options. At least what I am using does take notice of the preferences set by the user. Thanks for this comment. All the best.