Repository navigation
Description
What happens
The skills show one way to override a lightweight styling key: define a new brush.
<SolidColorBrush x:Key="FilledButtonBackground" Color="#006D3B" />An agent that follows them writes a new brush for every key it overrides, even when the value is a brush the theme already has. In one generated app, 15 tab bar and chip keys were each written as <SolidColorBrush x:Key="ChipBackgroundChecked" Color="{ThemeResource PrimaryColor}" />, once in Light and again, identically, in Default.
What should happen
When the new value is an existing resource, the override is an alias, written once:
<StaticResource x:Key="ChipBackgroundChecked" ResourceKey="PrimaryBrush" />A new SolidColorBrush, with Light and Default values, is only for a colour the palette does not have.
This applies to every lightweight styling key: WinUI, Uno Themes (Material and Simple) and Uno Toolkit controls, on semantic and non-semantic styles alike.
Proposed changes (under plugins/uno-platform-studio/skills/, then the skills/ mirror)
uno-themes/references/semantic-colors-brushes.md, Part 4- "Method 2: Override Specific Brushes (Targeted)": state the rule above and show the alias first. Keep the
SolidColorBrushexample for a colour outside the palette. - "Method 3: Override Per-Control Instance (Scoped)": same rule for the scoped case.
- "Method 2: Override Specific Brushes (Targeted)": state the rule above and show the alias first. Keep the
uno-themes/references/simple.md, Customization Methods, item 3: replace theSolidColorBrushone-liner with the alias, or point to Part 4.uno-themes/references/material-customization.md, Customization, item 2: same.uno-themes/SKILL.md, "Restyle through resource keys, not copied templates": add one sentence with the rule, since this is the line an agent reads before any reference.uno-toolkit/references/lightweight-styling.md, Key Principles: one line pointing to the rule inuno-themes. It has no XAML example today.evals/uno-themes: a case that overrides a lightweight key to a theme brush, with a grader that fails on a newSolidColorBrushfor it.
Notes
- The skills already say this for app-named brushes ("use a role through its brush"); it is not carried through to lightweight keys.
- Not yet checked: that an alias placed at app scope follows a Light/Dark switch and a Hot Reload update in a running app. Worth one check before the wording lands.
Activity
kazo0 commentedon Nov 14, 2026
Two more rules, from the next generated app
With the alias rule in place, the next app wrote 27 alias overrides. 15 of them change nothing on screen:
<StaticResource x:Key="OutlinedButtonBorderBrush" ResourceKey="OutlineBrush" />: Simple already resolves that key toOutlineBrush, throughFilledTonalButtonBorderBrush. The same goes forFilledButtonBackground,TextButtonForeground,ChipBackgroundChecked,ChipBorderBrush,DividerForeground,BottomTabBarBackgroundand others.utu:CardContentControl, but it overrodeFilledCardBackground,OutlinedCardBorderBrushandCardForeground. Onlyutu:Cardreads those keys.The example in this issue's description has the same problem:
ChipBackgroundChecked→PrimaryBrushis already Simple's default.Rules to add next to the alias rule
utu:CardContentControlreads the*CardContent*keys, not the*Card*ones.What the skills need for rule 1
An agent can follow rule 1 only if it knows each key's default. Where a reference lists keys, give each one's default for Simple and for Material. Pick an example key whose default differs from the override, such as
TabBarItemForegroundSelected→PrimaryBrush(the Simple default isOnSurfaceBrush).Simple cards
Source:
Uno.Toolkit.Simple/Styles/Controls/CardContentControl.xaml.FilledCardContentBackgroundis the background of every card.OutlinedCardContentBorderBrushis the border of both Outlined and Elevated.OutlinedCardContentBackgroundand theElevated*keys are defined but never read.OnSurfaceBrushdirectly; no key controls it.This is worth a line in
uno-toolkit/references/card.md. Today the skills say to copy keys from the control's doc table, and that leads to overrides with no effect.fix(skills): alias an existing brush when overriding a lightweight st…