Skip to content

fix(skills): alias an existing brush when overriding a lightweight styling key - #237

Merged
kazo0 merged 2 commits into
mainfrom
dev-sb/github-issue-236-474763
Nov 15, 2026
Merged

kazo0 merged 2 commits into
mainfrom
dev-sb/github-issue-236-474763

Conversation

@kazo0

@kazo0 kazo0 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

GitHub Issue (If applicable): closes #236

PR Type

  • Bugfix
  • Documentation content changes

What is the current behavior?

The skills show only one way to override a lightweight styling key: a new SolidColorBrush. Agents follow that and write a new brush even when the value is a brush the theme already has, often wrapping a role (Color="{ThemeResource PrimaryColor}") and repeating it in Light and Default.

What is the new behavior?

When the new value is an existing theme brush, the override is an alias written once: <StaticResource x:Key="FilledButtonBackground" ResourceKey="TertiaryBrush" />. A per-theme SolidColorBrush is only for a colour outside the palette.

  • uno-themes/references/semantic-colors-brushes.md, Part 4: Method 2 states the rule and shows the alias first. It says the alias element is a resource definition and doesn't change the {ThemeResource} rule for properties. The off-palette example now has both Light and Default. Method 3 applies the same rule at control scope.
  • uno-themes/references/simple.md and material-customization.md: the alias one-liner, plus a pointer to Part 4.
  • uno-themes/SKILL.md: one sentence in "Restyle through resource keys, not copied templates".
  • uno-toolkit/references/lightweight-styling.md: a Key Principles line pointing to the rule.
  • evals/uno-themes/lightweight-key-alias: new case, with graders for the alias (either attribute order), no SolidColorBrush wrapping a theme colour, and a judge that each key is defined once.
  • evals/uno-themes/simple-danger-and-error: the two rubrics described a SolidColorBrush override as acceptable; they now describe the alias.
  • Override only to change. semantic-colors-brushes.md Method 2, uno-themes/SKILL.md and lightweight-styling.md now say to check a key's default first, and to override the keys of the control the page uses. The alias example was itself a no-op (ChipBackgroundChecked is already PrimaryBrush in Simple); it is now TabBarItemForegroundSelected → PrimaryBrush.
  • uno-toolkit/references/card.md: a short table of the keys a Simple CardContentControl reads, with defaults. The Card keys (FilledCardBackground, CardForeground) do not reach it.
  • skills/ mirror re-synced.

PR Checklist

  • Documentation has been added/updated
  • Associated with an issue (GitHub or internal)

Additional Information

Runtime check (the issue's open note). I tested a throwaway Material app on Uno.Sdk 7.1.0-dev.18, net10.0-desktop:

  • App scope: one alias in App.xaml, outside ThemeDictionaries (FilledButtonBackground → TertiaryBrush). The live button matched the active theme's TertiaryBrush across Dark → Light → Dark.
  • Control scope: an alias in Button.Resources (SecondaryBrush). Same result.
  • Hot Reload: editing the alias target in MainPage.xaml updated the running button. An edit in App.xaml was reported as applied but didn't change the button. I didn't compare it with a SolidColorBrush edit there.
  • Uno source: ResourceDictionary.TryResolveAlias resolves the alias on every lookup under the active theme and doesn't cache it, which matches the desktop result.

Not verified: the Windows (WinUI) head. Package registration failed locally. Uno.Themes' own control dictionaries repeat each alias in Light and Default. If native WinUI resolves an app-scope alias only once, the wording should switch to one alias per theme dictionary. Please check on Windows before merging.

Checks. Test-Plugin.ps1 and Test-EvalCases.ps1 pass. simple.md and card.md were already over the 6,000-character warning; they grow by about 90 and 760 characters. I didn't run Invoke-Evals.ps1.

🤖 Generated with Claude Code

kazo0 and others added 2 commits November 13, 2026 19:12
…yling key

The uno-themes references only showed a new SolidColorBrush for a
lightweight styling override, so agents wrapped theme roles in new
brushes and repeated them in Light and Default. Teach the alias,
written once, and keep a per-theme SolidColorBrush for colours outside
the palette. Add a uno-themes eval case for it.

Closes #236

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- A key set to the brush the theme already gives it does nothing; the skills now say to check the default first.
- The alias example was itself a default (ChipBackgroundChecked is PrimaryBrush in Simple); it is now TabBarItemForegroundSelected.
- A CardContentControl reads the CardContent keys, not the Card ones; card.md lists the keys Simple reads and their defaults.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kazo0
kazo0 merged commit f0efa31 into main Nov 15, 2026
7 checks passed
@kazo0
kazo0 deleted the dev-sb/github-issue-236-474763 branch November 15, 2026 17:38
@kazo0

kazo0 commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

@Mergifyio backport release/stable/7.0

@mergify

mergify Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

backport release/stable/7.0

✅ Backports have been created

Details

Cherry-pick of f0efa31 has failed:

On branch mergify/bp/release/stable/7.0/pr-237
Your branch is up to date with 'origin/release/stable/7.0'.

You are currently cherry-picking commit f0efa31.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   evals/uno-themes/lightweight-key-alias/graders/alias-filled-background.md
	new file:   evals/uno-themes/lightweight-key-alias/graders/loads-skill.md
	new file:   evals/uno-themes/lightweight-key-alias/graders/no-brush-wrapping-a-role.md
	new file:   evals/uno-themes/lightweight-key-alias/graders/rubric-written-once.md
	new file:   evals/uno-themes/lightweight-key-alias/prompt.md
	modified:   plugins/uno-platform-studio/skills/uno-themes/SKILL.md
	modified:   plugins/uno-platform-studio/skills/uno-themes/references/material-customization.md
	modified:   plugins/uno-platform-studio/skills/uno-themes/references/semantic-colors-brushes.md
	modified:   plugins/uno-platform-studio/skills/uno-themes/references/simple.md
	modified:   plugins/uno-platform-studio/skills/uno-toolkit/references/card.md
	modified:   plugins/uno-platform-studio/skills/uno-toolkit/references/lightweight-styling.md
	modified:   skills/uno-themes/SKILL.md
	modified:   skills/uno-themes/references/material-customization.md
	modified:   skills/uno-themes/references/semantic-colors-brushes.md
	modified:   skills/uno-themes/references/simple.md
	modified:   skills/uno-toolkit/references/card.md
	modified:   skills/uno-toolkit/references/lightweight-styling.md

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	deleted by us:   evals/uno-themes/simple-danger-and-error/graders/rubric-danger-button.md
	deleted by us:   evals/uno-themes/simple-danger-and-error/graders/rubric-error-textbox.md

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

kazo0 added a commit that referenced this pull request Nov 15, 2026
…yling key (#237) (#238)

* fix(skills): alias an existing brush when overriding a lightweight styling key

The uno-themes references only showed a new SolidColorBrush for a
lightweight styling override, so agents wrapped theme roles in new
brushes and repeated them in Light and Default. Teach the alias,
written once, and keep a per-theme SolidColorBrush for colours outside
the palette. Add a uno-themes eval case for it.

Closes #236

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(skills): override a lightweight key only to change it

- A key set to the brush the theme already gives it does nothing; the skills now say to check the default first.
- The alias example was itself a default (ChipBackgroundChecked is PrimaryBrush in Simple); it is now TabBarItemForegroundSelected.
- A CardContentControl reads the CardContent keys, not the Card ones; card.md lists the keys Simple reads and their defaults.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
(cherry picked from commit f0efa31)

# Conflicts:
#	evals/uno-themes/simple-danger-and-error/graders/rubric-danger-button.md
#	evals/uno-themes/simple-danger-and-error/graders/rubric-error-textbox.md

Co-authored-by: Steve Bilogan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Skills teach a new brush where a lightweight styling override should alias an existing one

1 participant