Start Using color-scheme CSS Property When Working With Dark/Light Themes @CSSWeekly
Start Using color-scheme CSS Property When Working With Dark/Light Themes  @CSSWeekly
Uploaded March 2022 | Updated September 2026, 2 hours ago
An introduction to color-scheme CSS property (and meta tag) which can change how native browser elements are renderedβ€”in light or dark mode.

I explain how color-scheme property works, why you should use it when you're offering a dark mode of your website, and I demonstrate what difference it makes if you apply it on Twitter, Linkedin, Netflix, and The Verge.

πŸ”— Codepen demo: codepen.io/ZoranJambor/pen/rNpwjmd/d9ce35066e4b6c3b3e45993819ddfe5f

πŸ“– Resources
color-scheme: developer.mozilla.org/en-US/docs/Web/CSS/color-scheme
prefers-color-scheme: developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme

Timestamps:
00:00 Introduction
00:31 Setup
00:54 How color-scheme property works
02:19 How color-scheme meta tag works
03:22 Apply color-scheme only to a part of the UI
04:18 How to use it with prefers-color-scheme media query
05:23 How to use it with theme-switcher
06:09 Importance of testing when applying color-scheme on existing websites
07:06 Applying color-scheme to twitter.com
08:13 Applying color-scheme to linkedin.com
09:22 Applying color-scheme to netflix.com
09:54 Applying color-scheme to theverge.com
10:26 Conclusion
#css

Subscribe to CSS Weekly Newsletter:
πŸ’Œ css-weekly.com

Keep up-to-date with CSS Weekly:
πŸ‘‰ Twitter: twitter.com/CSSWeekly
πŸ‘‰ Instagram: instagram.com/cssweekly
πŸ‘‰ Facebook: facebook.com/CSSWeekly

Keep up to date with what I'm up to:
πŸ”— Blog: zoranjambor.com
πŸ‘‰ Twitter: twitter.com/zoranjambor
πŸ‘‰ LinkedIn: linkedin.com/in/zoranjambor

- Zoran Jambor
Start Using color-scheme CSS Property When Working With Dark/Light ThemesHow To Create Animated Anchor Links Using CSSVS Code Tips β€” How to solve all your CSS problems instantlyFlexbox β€” justify-content or align-items?!? #cssUse THIS CSS Property To Improve Your Rounded Corners TodayTips on Starting a Webdev YouTube Channel in 2023A Practical, Hands-On Guide to Improving Your UI (JavaScriptmas Challenge)Top 5 CSS Navigation Menu MistakesCreate Performant, Stylable Map UI Components Using MapSVGFrontend News #16: :heading Pseudo-Class, Faded Text Effects, box-sizingPlay/Pause All CSS Animations on a Page Using DevTools ConsoleWhere is CSS4? #css #css4
CSS Weekly |

Start Using color-scheme CSS Property When Working With Dark/Light Themes

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER