brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: color-scheme: light dark gives form controls and scrollbars a dark mode

Css
~/tips/tip-css-color-scheme

color-scheme: light dark;

Tells the browser your page supports light and dark, so default controls match the visitor's setting.

You styled a dark page, and then a white input box and a white scrollbar spoil it.

:root {
  color-scheme: light dark;
}

The browser now draws its own parts (inputs, scrollbars, default backgrounds) in the scheme of the visitor. It does not restyle your own colours, so you still need your own dark variables or prefers-color-scheme rules.

Further reading: color-scheme on MDN

More Css tips CSS Overview in Chrome DevTools audits the colors and fonts of a page .notice:empty { .toast { article { counter-reset: h2; } .toolbar { All Css tips (66) All topics

Link