Twitter | Pretraživanje | |
Thomas Steiner
I have done a ton of research 🥼, coded a lot of examples 👨‍💻, released a custom element `<dark-mode-toggle>` 🔅🔆, and picked some of the smartest brains 🧠 inside and outside of Google to make my latest article happen… 🌒 Hello Darkness, My Old Friend!
Many devices now support an operating system wide dark mode or dark theme experience. This post explains how dark mode can be supported on web pages, lists best practices, and introduces a custom...
Reply Retweet Označi sa "sviđa mi se" More
Timothy Hatcher 27. lip
Odgovor korisniku/ci @tomayac
Nice write up. One comment on `currentColor` you can use <svg><use xlink:href=“…”></svg> to have separate resources and still use `currentColor` in context. We do this in Web Inspector. Mentioned here:
Reply Retweet Označi sa "sviđa mi se"
Thomas Steiner 27. lip
Odgovor korisniku/ci @xeenon
Thanks for the kind words! 😊 I consider this more of a general SVG advice, but definitely great idea to mention that `currentColor` works even in the reference () context. I’ll add this. Your great 👏 work is linked () by the way!
Reply Retweet Označi sa "sviđa mi se"
Alexey Rodionov 27. lip
Odgovor korisniku/ci @tomayac
Great research! 👍 Thanks! I'm curious how to calculate the color values of icons, text, etc. for the dark theme from the values for the light theme? Is there any algorithm to keep an acceptable contrast ratio? The inverted colors looks ugly…
Reply Retweet Označi sa "sviđa mi se"
Thomas Steiner 27. lip
Odgovor korisniku/ci @alexey_rodionov
No algorithm that I was aware of. One approach to get closer to usable values might be applying `filter: invert() hue-rotate(180deg)` and then working based off these values, but your actual mileage may vary.
Reply Retweet Označi sa "sviđa mi se"
John Brandenburg 13. ruj
Odgovor korisniku/ci @tomayac
How does one enable this in ubuntu? I don't seem to have a system setting toggle.
Reply Retweet Označi sa "sviđa mi se"
Thomas Steiner 14. ruj
Odgovor korisniku/ci @johnbburg
Setting a dark theme on your system should be enough, but currently there’s a bug , so temporary you need to launch Chrome with these two flags: --enable-features=WebUIDarkMode --force-dark-mode
Reply Retweet Označi sa "sviđa mi se"