Uploaded October 2026 | Updated November 2026, 3 hours ago
£955 of Claude credits and eight days of 24-hour sessions on a local RTX 6000 Pro — and about £350 of it gone when the model I'm training started cheating with hard-coded strings and padding to fake pixel-perfect alignment.
Along the way: the prototype renamed to default and perfected by hand, a theme philosophy file that puts the model back in line, a control gallery previewing every control in light and dark, the web-render flip that stops hover cropping, mathematically perfect concentric corners, clean icon support, and a hue-aware colour ramp that makes dark-mode accents actually legible. Part of a complete series on building a fully custom Avalonia UI theme from scratch, hand-coded with zero AI.
━━━━━━━━━━━━━━━━━━━
📌 WHAT YOU'LL LEARN
━━━━━━━━━━━━━━━━━━━
• Why the model started "cheating" with hard-coded strings — and the theme philosophy file that put it back in line
• How to build a control gallery that previews every control in light and dark from one source of truth
• How the web-render style flips ClipToBounds so hover transforms stop cropping inside lists
• Why Avalonia renders the opposite of websites, and how a natural hover Z index restores expected stacking
• How mathematically calculated concentric corners give pixel-perfect inner radii with no fudged values
• How to add clean icon support by binding Icon.Data instead of introducing a new control
• How a hue-aware colour ramp fixes low-contrast accents, especially yellows in dark mode
• Why legibility wins over pure visuals: contrast-first choices avoid accessibility problems
━━━━━━━━━━━━━━━━━━━
⏱ TIMESTAMPS
━━━━━━━━━━━━━━━━━━━
[0:00] – Framebuffer breakthrough recap and where the training stands
[0:46] – Prototype renamed to default
[1:05] – Remaking the Cupertino theme, until the model starts cheating
[1:23] – The theme philosophy file that enforces the rules
[1:51] – Four days of work deleted, £350 of credit burned
[2:02] – Splitting the training: layout first, themes second
[2:33] – Moving the light/dark preview into a static resource
[3:04] – The control gallery page with a dynamic sidebar
[3:29] – The annoyance: static resources need a recompile to update
[4:02] – Reviewing a week of agent-written code live
[4:31] – Inside the GalleryCatalog view model
[5:17] – Briefing the agent: reflect the entries instead of listing them
[6:13] – Repeating the preview treatment across all controls
[6:24] – The web-render style: flipping ClipToBounds by default
[7:44] – Adding a natural hover Z index, just like the web
[8:44] – Corner radii that are finally mathematically perfect
[9:09] – Clean icon support through Icon.Data bindings
[9:43] – The concentric-corner maths behind the clipping
[11:11] – The hue-aware colour ramp and why contrast matters
[12:54] – Scrollbar cleanup and ScrollView bottom-padding fix
[13:18] – Still to do: theme colours and states on every control
[13:53] – Before and after renders of the hue ramp
[14:38] – What nearly £1,000 bought: tools, rules and a private guard
[15:56] – Next up: reviewing the week of agent-written code
[16:41] – Confirming the reflection refactor compiles and works
━━━━━━━━━━━━━━━━━━━
🔗 LINKS & RESOURCES
━━━━━━━━━━━━━━━━━━━
▶ Full Avalonia Themes Playlist: youtube.com/playlist?list=PLrW43fNmjaQVE2vDBeWD8QYIm06w6bKyO
▶ Source Code (AvaloniaThemeLab): github.com/angelsix/youtube/tree/develop/AvaloniaThemeLab
▶ GitHub: github.com/angelsix
▶ Website: angelsix.com
━━━━━━━━━━━━━━━━━━━
📚 SERIES — Avalonia UI Theming, Hand Coded From Scratch
━━━━━━━━━━━━━━━━━━━
▶ Full series: youtube.com/playlist?list=PLrW43fNmjaQVE2vDBeWD8QYIm06w6bKyO
17 — A Maintainable Token System — youtube.com/watch?v=tg2gSQRJtmY
18 — Automatic Dark Mode From a Single Theme — youtube.com/watch?v=m2WjfZAOUyM
19 — Calendar Control From Scratch — youtube.com/watch?v=EZE8MFbcoAE
20 — Build a Light vs Dark Preview Control — youtube.com/watch?v=tYTMNrN-3rw
21 — This Video — Theme Bug Fixing: Hover Cropping, Corners, Contrast
£955 of Claude credits and eight days of 24-hour sessions on a local RTX 6000 Pro — and about £350 of it gone when the model I'm training started cheating with hard-coded strings and padding to fake pixel-perfect alignment.
Along the way: the prototype renamed to default and perfected by hand, a theme philosophy file that puts the model back in line, a control gallery previewing every control in light and dark, the web-render flip that stops hover cropping, mathematically perfect concentric corners, clean icon support, and a hue-aware colour ramp that makes dark-mode accents actually legible. Part of a complete series on building a fully custom Avalonia UI theme from scratch, hand-coded with zero AI.
━━━━━━━━━━━━━━━━━━━
📌 WHAT YOU'LL LEARN
━━━━━━━━━━━━━━━━━━━
• Why the model started "cheating" with hard-coded strings — and the theme philosophy file that put it back in line
• How to build a control gallery that previews every control in light and dark from one source of truth
• How the web-render style flips ClipToBounds so hover transforms stop cropping inside lists
• Why Avalonia renders the opposite of websites, and how a natural hover Z index restores expected stacking
• How mathematically calculated concentric corners give pixel-perfect inner radii with no fudged values
• How to add clean icon support by binding Icon.Data instead of introducing a new control
• How a hue-aware colour ramp fixes low-contrast accents, especially yellows in dark mode
• Why legibility wins over pure visuals: contrast-first choices avoid accessibility problems
━━━━━━━━━━━━━━━━━━━
⏱ TIMESTAMPS
━━━━━━━━━━━━━━━━━━━
[0:00] – Framebuffer breakthrough recap and where the training stands
[0:46] – Prototype renamed to default
[1:05] – Remaking the Cupertino theme, until the model starts cheating
[1:23] – The theme philosophy file that enforces the rules
[1:51] – Four days of work deleted, £350 of credit burned
[2:02] – Splitting the training: layout first, themes second
[2:33] – Moving the light/dark preview into a static resource
[3:04] – The control gallery page with a dynamic sidebar
[3:29] – The annoyance: static resources need a recompile to update
[4:02] – Reviewing a week of agent-written code live
[4:31] – Inside the GalleryCatalog view model
[5:17] – Briefing the agent: reflect the entries instead of listing them
[6:13] – Repeating the preview treatment across all controls
[6:24] – The web-render style: flipping ClipToBounds by default
[7:44] – Adding a natural hover Z index, just like the web
[8:44] – Corner radii that are finally mathematically perfect
[9:09] – Clean icon support through Icon.Data bindings
[9:43] – The concentric-corner maths behind the clipping
[11:11] – The hue-aware colour ramp and why contrast matters
[12:54] – Scrollbar cleanup and ScrollView bottom-padding fix
[13:18] – Still to do: theme colours and states on every control
[13:53] – Before and after renders of the hue ramp
[14:38] – What nearly £1,000 bought: tools, rules and a private guard
[15:56] – Next up: reviewing the week of agent-written code
[16:41] – Confirming the reflection refactor compiles and works
━━━━━━━━━━━━━━━━━━━
🔗 LINKS & RESOURCES
━━━━━━━━━━━━━━━━━━━
▶ Full Avalonia Themes Playlist: youtube.com/playlist?list=PLrW43fNmjaQVE2vDBeWD8QYIm06w6bKyO
▶ Source Code (AvaloniaThemeLab): github.com/angelsix/youtube/tree/develop/AvaloniaThemeLab
▶ GitHub: github.com/angelsix
▶ Website: angelsix.com
━━━━━━━━━━━━━━━━━━━
📚 SERIES — Avalonia UI Theming, Hand Coded From Scratch
━━━━━━━━━━━━━━━━━━━
▶ Full series: youtube.com/playlist?list=PLrW43fNmjaQVE2vDBeWD8QYIm06w6bKyO
17 — A Maintainable Token System — youtube.com/watch?v=tg2gSQRJtmY
18 — Automatic Dark Mode From a Single Theme — youtube.com/watch?v=m2WjfZAOUyM
19 — Calendar Control From Scratch — youtube.com/watch?v=EZE8MFbcoAE
20 — Build a Light vs Dark Preview Control — youtube.com/watch?v=tYTMNrN-3rw
21 — This Video — Theme Bug Fixing: Hover Cropping, Corners, Contrast






![Building a Design Token System | Dev + AI
The theme engine is live — now it needs a proper foundation. In this episode I work through
the design of a complete design token system: the minimal, compact set of values that define
every visual property in a theme. Colours, spacing, radius, stroke, scaling — all architected
from first principles.
And yes, I used AI. Not to write the code — but as a collaborator in the design process.
The human makes every decision. The AI challenges, refines, and fills gaps. This is what
correct AI usage looks like: not vibe coding, not outsourcing — genuine engineering with a
powerful tool in your hands.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📌 WHAT YOULL LEARN
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• How the new source generator eliminates manual theme compilation — with full IntelliSense
• What a design token system actually is and why it matters for scalable UI theming
• Foundation tokens vs semantic tokens — and how the two layers interact
• Semantic colour naming: Surface, On-Surface, Accent, and why background/foreground falls short
• How a single BaseSize value scales every margin, padding, font and spacing proportionally
• Defining overlay layers for hover, pressed, and disabled states without hardcoding values
• How to use AI as a design collaborator — prompting, pushing back, and staying in control
• Why AI loses context over long sessions and how to manage it without losing your work
• The final locked design token plan — ready for implementation
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⏱ TIMESTAMPS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[0:00] – Introduction & recap of the new theme engine
[0:40] – Installing the Angel6.ThemeEngine NuGet package
[1:19] – Defining a theme class with the [Theme] attribute
[1:49] – Injecting ThemeContext via dependency injection
[2:48] – Theme class properties in practice
[4:54] – Using theme: prefix in XAML with full IntelliSense
[6:10] – Source generator demo — instantaneous updates, no recompile
[7:55] – Why we need a design token system — entering AI collaboration
[9:28] – AI names it: design token system and confirms the concept
[11:56] – AIs first proposed architecture: colours, sizing, radius
[14:16] – Pushing back — more accent colours, base size scaling, real zoom
[17:20] – AIs revised plan: semantic colours, UI zoom, proportional scaling
[19:06] – AI creates the plan file using its planning skill
[22:10] – Brainstorming plan locked in the /plans folder
[25:06] – Closing questions: spacing levels, radius, overlays, accent derivation
[27:04] – AIs response — overlay layers, scale implementation, pastel accents
[30:00] – Further feedback: base size as derived properties, not render transform
[33:09] – Agreeing on scale implementation approach
[34:38] – Locking in the accent colour palette values
[36:27] – AI refines the plan with strong opinions acknowledged
[39:12] – Plan locked — ready for implementation
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔗 LINKS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▶ Part 1 – Setup: https://www.youtube.com/watch?v=rUKlQnjU0tc
▶ Part 2 – Buttons: https://www.youtube.com/watch?v=oKjk6pyyARI
▶ Part 3 – Button Spinner Anatomy: https://www.youtube.com/watch?v=WMaTbXkvm9g
▶ Part 4 – Designing a Theme System: https://www.youtube.com/watch?v=I5halHoNfH0
▶ Part 5 – Checkbox Anatomy: https://www.youtube.com/watch?v=uIimnwjITT0
▶ Part 6 – Checkbox Styling: https://www.youtube.com/watch?v=uv1bNrfCjtY
▶ Part 7 – Theme Engine From Scratch: https://www.youtube.com/watch?v=NXz8hwITg5U
📺 Full Series Playlist: https://www.youtube.com/playlist?list=PLrW43fNmjaQVE2vDBeWD8QYIm06w6bKyO
💾 Source Code: https://github.com/angelsix/youtube/tree/develop/AvaloniaThemeLab
🌐 AngelSix: https://www.angelsix.com
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📺 SERIES: Avalonia UI Theming – Hand Coded From Scratch
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
#avalonia #avaloniaui #xaml #csharp #dotnet #uiux #desktopapp #softwaretutorial #coding Building a Design Token System | Dev + AI](https://i.ytimg.com/vi/QMVdxRZqaU8/mqdefault.jpg)



