skills/unity-app-ui-theming/SKILL.md
Expert for App UI theming and styling - USS variables, custom themes, dark/light mode, scale factors, and BEM conventions. Use this skill whenever the user wants to change colors, create a branded theme, customize fonts or typography, adjust spacing, implement dark/light mode switching, toggle between themes at runtime, set up responsive scaling (small/medium/large), register custom icons, style components with USS variables, apply BEM naming conventions, create a .tss or .uss file, or configure PanelSettings for theming. Also trigger when the user mentions design tokens, appui-- prefix, ThemeContext, ScaleContext, or asks about color palettes and USS variable overrides.
npx skillsauth add cuozg/oh-my-skills unity-app-ui-themingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Master the App UI theming system to customize colors, typography, spacing, and create consistent, branded UI experiences.
App UI provides a powerful theming system based on USS (Unity Style Sheet) variables and design tokens. This allows you to create cohesive visual experiences across your applications while maintaining consistency through a comprehensive design system.
The App UI theming system is built on layered USS stylesheets:
App UI - Palette.uss) - Base color definitionsApp UI - Alias.uss) - Semantic color mappingsApp UI - Dark.uss, App UI - Light.uss) - Theme-specific overridesApp UI - Small.uss, App UI - Medium.uss, App UI - Large.uss) - Responsive scalingApp UI provides four built-in themes, each available in three scale variants:
Scale contexts adjust UI size based on device pixel density:
A complete custom theme requires two files:
Stylesheet (.uss) - Contains USS variables with the custom theme class:
.appui--customThemeName {
--appui-primary-100: #E3F2FD;
--appui-primary-200: #BBDEFB;
--appui-primary-300: #90CAF9;
/* ... more color overrides ... */
}
Theme File (.tss) - References the stylesheet for use in PanelSettings:
@import url("custom-theme.uss");
VisualElement {}
Always use the appui-- prefix for custom theme class names:
/* Correct */
.appui--mytheme { }
.appui--brandColors { }
/* Incorrect */
.mytheme { }
.custom-theme { }
App UI provides organized design tokens across multiple categories:
Color Tokens:
--appui-primary-* (25 through 1300)--appui-accent-*--appui-positive-*, --appui-warning-*, --appui-destructive-*--appui-backgrounds-*--appui-foregrounds-*Spacing Tokens:
--appui-spacing-* for padding, margin, gapsTypography:
--appui-font-weights-100 - Regular weight--appui-font-weights-200 - SemiBold weight:root selectorSwitch themes at runtime using ThemeContext:
// Get the current theme context
var element = GetThemeAwareElement();
var themeContext = element.GetContext<ThemeContext>();
// Switch to different theme
element.ProvideContext(new ThemeContext("light"));
element.ProvideContext(new ThemeContext("dark"));
element.ProvideContext(new ThemeContext("appui--customTheme"));
Adjust UI size based on device scale:
// Get scale context
var scaleContext = element.GetContext<ScaleContext>();
// Change scale at runtime
element.ProvideContext(new ScaleContext("small"));
element.ProvideContext(new ScaleContext("medium"));
element.ProvideContext(new ScaleContext("large"));
App UI follows BEM (Block, Element, Modifier) for all CSS class names:
/* Block */
.appui-button { }
/* Element */
.appui-button__icon { }
/* Modifier */
.appui-button--primary { }
.appui-button--disabled { }
/* Combined */
.appui-button__icon--right { }
When creating custom styles:
.appui-mycomponent { }
.appui-mycomponent__header { }
.appui-mycomponent--dark { }
.appui-mycomponent__header--highlighted { }
Register custom icons following App UI naming conventions:
.appui-icon--myicon--regular {
--unity-image: url("path/to/myicon.png");
}
.appui-icon--myicon--bold {
--unity-image: url("path/to/myicon-bold.png");
}
Icon variants supported:
Use in UXML:
<appui:Icon name="myicon" variant="Regular" />
<appui:Icon name="myicon" variant="Bold" />
Override default fonts at the root level:
:root {
--appui-font-weights-100: url("path/to/CustomFont-Regular.ttf");
--appui-font-weights-200: url("path/to/CustomFont-SemiBold.ttf");
}
Or use Unity Font Assets for better fallback support:
:root {
--appui-font-weights-100: resource("Fonts/MyCustomFont");
}
Always reference your theme file in PanelSettings:
Full example structure:
Assets/
MyThemeAssets/
MyTheme.tss (Theme file)
MyTheme.uss (Stylesheet)
MyTheme.uss:
@import url("App UI - Palette.uss");
.appui--mytheme {
--appui-primary-100: #E8F4F8;
--appui-primary-200: #B8DFF0;
--appui-primary-300: #88CAE8;
/* Complete palette override */
}
/* Custom component styles */
.appui-mycomponent {
padding: var(--appui-spacing-200);
background-color: var(--appui-backgrounds-100);
}
MyTheme.tss:
@import url("MyTheme.uss");
VisualElement {}
appui-- prefix - Required for proper theme identification and context switching@import url("App UI - Palette.uss") for color variable accessApp UI uses a 25-step color density scale (25, 50, 75... up to 1300) allowing:
Packages/com.unity.dt.app-ui/PackageResources/Styles/Themes/Packages/com.unity.dt.app-ui/PackageResources/Icons/Packages/com.unity.dt.app-ui/PackageResources/Fonts/Consult reference.md when you need the full list of USS design token variables (all color, spacing, and typography tokens), exact ThemeContext/ScaleContext API signatures, complete custom theme examples, high-DPI icon registration details, or PanelSettings configuration steps. See examples/ for complete custom theme USS templates.
tools
Generate Unity raster image assets through Unity MCP: game sprites, item art, backgrounds, UI icons, portraits, concept images, transparent cutouts, image edits, upscales, background removal, and Unity scene or Game View screenshots. Use when a Unity project needs image files imported under Assets or screenshots captured from the editor. Do not use for meshes, audio, animation, materials, gameplay code, UI Toolkit layout, or generic non-Unity image generation.
tools
Create Unity technical solution documents from user requirements, feature ideas, bug goals, specs, or codebase problems. Use when the user asks for a technical approach, architecture, implementation strategy, solution options, feasibility analysis, system design, or "how should we build/fix this" for Unity runtime, Editor, tools, assets, data, UI, WebGL, SDKs, or production pipelines.
tools
Orchestrate Unity Editor via MCP (Model Context Protocol) tools and resources. Use when working with Unity projects through MCP for Unity - creating/modifying GameObjects, editing scripts, managing scenes, running tests, or any Unity Editor automation. Provides best practices, tool schemas, and workflow patterns for effective Unity-MCP integration.
development
Convert a spec document into an implementation TODO list in the same spec folder. U se when the user says goal-todo, todo from spec, generate tasks from spec, turn this spec into todos, create implementation checklist, extract tasks, or asks to read a Docs/Specs design doc and produce what must be implemented. Includes UI/UX review and codebase investigation before writing the checklist. Do not use for implementing the tasks, creating new goal files, writing test cases, or verifying completed work.