惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Blog — PlanetScale
Blog — PlanetScale
G
Google Developers Blog
Microsoft Security Blog
Microsoft Security Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
腾讯CDC
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Jina AI
Jina AI
雷峰网
雷峰网
T
Tailwind CSS Blog
爱范儿
爱范儿
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
酷 壳 – CoolShell
酷 壳 – CoolShell
大猫的无限游戏
大猫的无限游戏
月光博客
月光博客
博客园 - 司徒正美
I
InfoQ
Engineering at Meta
Engineering at Meta
Vercel News
Vercel News
小众软件
小众软件
U
Unit 42
Google DeepMind News
Google DeepMind News
D
DataBreaches.Net

Syntax - Tasty Web Development Treats

Diffs, Trees, and VS Code 2.0 - Syntax #1008 8 Tech Choices to Lock In Before Agentmaxxing - Syntax #1007 Can AI Make Good Design? - Syntax #1006 Programatic and Skill based Video Creation with Remotion - Syntax #1005 TanHacked - Syntax #1004 Skills Skills Skills - Syntax #1003 The Real Pricing of LLMs - Syntax #1002 Managing Deadlines + Stress - Syntax #1001 Syntax Episode 1,000! - Syntax #1000 Writing Maintainable CSS - Syntax #999 How to Fix Vibe Coding - Syntax #998 Rating and Roasting Your Projects - Syntax #997 10 New CSS and HTML APIs - Syntax #996 Next.js Vendor Lock-in No More - Syntax #995 AI Sucks At CSS - Syntax #994 It’s Been A Hell Of Week - Syntax #993 Migrating Legacy Code Just Got Easier - Syntax #992 Vite’s bet on Cloudflare (VOID Framework) - Syntax #991 Vite Is Taking Over (Vite+) - Syntax #990 State of JS 2025 - Syntax #989 Cloudflare’s Next.js Slop Fork - Syntax #988 Remote Coding Agents - Syntax #987 Does Code Quality Matter Anymore? - Syntax #986 Stop putting secrets in .env - Syntax #985 How to Make a DOM Library Render Anything w/ Paolo Ricciuti - Syntax #984 Why I Chose Electron Over Native (And I’d Do It Again) - Syntax #983 Bots Are Ruining the Internet - Syntax #982 Browsers Are Finally Catching Up (Interop 2026) - Syntax #981 AI Coding Explained - Syntax #980 WebMCP: New Standard to Expose Your Apps to AI - Syntax #979
Light and Dark Mode - Syntax #891
2025-04-07 · via Syntax - Tasty Web Development Treats
891

April 7th, 2025 × #CSS#Accessibility#Frontend

Discussion on adding light and dark modes to sites, considerations when doing so, and new CSS features to help

Wes Bos

Wes Bos Host

Scott Tolinski

Scott Tolinski Host

Light mode? Dark mode? Scott and Wes break down the best ways to implement theme switching in CSS, from prefers-color-scheme to manual overrides. Plus, tips on handling shadows, icons, and the dreaded flash of dark mode!

Show Notes

  • 00:00 Welcome to Syntax!
  • 01:05 Brought to you by Sentry.io.
  • 02:06 Light and dark mode, things to consider.
  • 02:31 Light and dark mode from scratch.
    • drop-in.css.
    • 04:41 Calculations vs assigned color.
    • 05:32 color-mix and relative color.
    • 08:15 Foreground and background variables.
      • --tint-or-shade: color-mix(in oklab, var(--fg), transparent 95%);
      • --tint-or-shade-harder: color-mix(in oklab, var(--fg), transparent 90%);
    • 09:13 Setting color scheme.
    • 12:38 light-dark function in CSS.
  • 15:48 Manually setting dark mode.
    • 18:43 The challenges with shared caching.
    • 19:33 Tailwind CSS implementation.
  • 19:52 Shoehorning in dark mode.
  • 22:25 Other things to consider.

Syntax: X Instagram Tiktok LinkedIn Threads

Wes: X Instagram Tiktok LinkedIn Threads

Scott: X Instagram Tiktok LinkedIn Threads

Randy: X Instagram YouTube Threads