How do I switch to Chromes dark scrollbar like GitHub does?

It’s the CSS property color-scheme. This will also apply the theme on form controls, background-color and text color. Currently supported on Chrome 81, Firefox 96 and Safari 13. MDN source: https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme :root { color-scheme: dark; } .container { padding: 25px; height: 2000px; } <div class=”container”> <div class=”text”>Dark Mode</div> <input type=”text” placeholder=”input with dark theme”/> </div> … Read more

How to detect if the OS is in dark mode in browsers?

The new standard is registered on W3C in Media Queries Level 5. NOTE: currently only available in Safari Technology Preview Release 68 In case user preference is light: /* Light mode */ @media (prefers-color-scheme: light) { body { background-color: white; color: black; } } In case user preference is dark: /* Dark mode */ @media … Read more

tech