Uploaded March 2023 | Updated September 2026, 2 weeks ago
Support me in my journey to giving back to the industry all my knowledge and helping the world with what I do. Spreading knowledge to those who cannot afford an education, and helping those who want to better themselves.
Avalonia UI
avaloniaui.net
Support what I do and pay for me to survive
angelsix.com/donate
Live Chat at Discord
discordapp.com/invite/eHr5BMk
Support me in my journey to giving back to the industry all my knowledge and helping the world with what I do. Spreading knowledge to those who cannot afford an education, and helping those who want to better themselves.
Avalonia UI
avaloniaui.net
Support what I do and pay for me to survive
angelsix.com/donate
Live Chat at Discord
discordapp.com/invite/eHr5BMk






![Automatic Dark Mode in Avalonia From a Single Theme
I built automatic dark mode directly into my Avalonia theme engine — one theme definition that handles light and dark for you.
No duplicate styles, no manual dark one / light seven on every control. Define your colors once, and source generators + color maps automatically convert contrasts, states, and ramps between modes. And when you dont like what it picks, you can override it per-brush.
This is part of a complete series on building a fully custom Avalonia UI theme from scratch, hand-coded with zero AI assistance.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📌 WHAT YOULL LEARN
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• How automatic dark mode works from a single theme definition
• How source generators bake light-to-dark conversion into the engine
• How to override auto colors per-brush - red in light, blue in dark
• Why fixed colors like dark one / light seven were replaced with tokens
• The new token system for theme defaults - surface, text, hover, background
• How changing one token value retints every button and label instantly
• How to scope dark mode to just one region of your UI
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⏱ TIMESTAMPS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[0:00] – Automatic dark mode from a single theme
[0:35] – Fully customizable - youre not locked in
[0:44] – How its baked into the theme engine with source generators
[1:16] – Demo - red accent in light becomes blue in dark
[2:16] – Coming next - opt-out flag for static colors
[3:07] – Open source update + what changed
[3:20] – Goodbye dark one / light seven - moving to tokens
[3:54] – New token system - surface, text, hover, background defaults
[5:30] – Demo - retint every button and label from one value
[6:32] – Fixing label inheritance in partial dark regions
[7:40] – Partial dark mode - theming just one region
[9:14] – Wrap + next up - remaking the date/calendar control
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔗 LINKS & RESOURCES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▶ Full Avalonia Themes Playlist: https://www.youtube.com/playlist?list=PLrW43fNmjaQVE2vDBeWD8QYIm06w6bKyO
▶ Source Code (AvaloniaThemeLab): https://github.com/angelsix/youtube/tree/develop/AvaloniaThemeLab
▶ GitHub: https://github.com/angelsix
▶ Website: https://www.angelsix.com
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📚 SERIES — Avalonia UI Theming – Hand Coded From Scratch
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
01 — Setup — https://www.youtube.com/watch?v=rUKlQnjU0tc
02 — Buttons | Hand Coded From Scratch — https://www.youtube.com/watch?v=oKjk6pyyARI
03 — Button Spinner | Anatomy & Internals — https://www.youtube.com/watch?v=WMaTbXkvm9g
04 — Designing a Theme System From Scratch — https://www.youtube.com/watch?v=I5halHoNfH0
05 — Checkbox Control Deep Dive — https://www.youtube.com/watch?v=uIimnwjITT0
06 — Checkbox Styling — https://www.youtube.com/watch?v=uv1bNrfCjtY
07 — Theme Engine From Scratch — https://www.youtube.com/watch?v=NXz8hwITg5U
08 — Building a Design Token System — https://www.youtube.com/watch?v=QMVdxRZqaU8
09 — One Token System for the Entire Theme — https://www.youtube.com/watch?v=JEcD1XXIiA8
10 — Avalonia Styles Not Working? Youre Breaking This Rule — https://www.youtube.com/watch?v=OhJN8Ssp2hA
11 — Avalonia Just Got a Full Icon System — https://www.youtube.com/watch?v=N5HPe5GYCPo
12 — Breaking Every Avalonia Control On Purpose — https://www.youtube.com/watch?v=OmVFU-iowqI
13 — Avalonia Tool That Finds Bugs My Compiler Cant See — https://www.youtube.com/watch?v=WQB5kFJWRmc
14 — The Avalonia Accent System That Generates Its Own Shades — https://www.youtube.com/watch?v=YFQEVLaYk94
15 — The Color Ramp That Themes Your Whole App — https://www.youtube.com/watch?v=xhnUQOOrShs
16 — Theme Token Reduction (One File, Every Control) — https://www.youtube.com/watch?v=tg2gSQRJtmY
17 — This Video — Automatic Dark Mode From a Single Theme
#avalonia #avaloniaui #xaml #csharp #dotnet #uiux #desktopapp #softwaretutorial #coding Automatic Dark Mode in Avalonia From a Single Theme](https://i.ytimg.com/vi/m2WjfZAOUyM/mqdefault.jpg)



