UI Toolkit (UITK) for Unity — create/edit USS stylesheets and UXML layouts, configure UIDocument + PanelSettings in scenes, generate EditorWindow / runtime UI scaffolds. This is the UXML/USS/VisualElement system; for Canvas-based UGUI use the `ui` module. Triggers: UI Toolkit, UITK, UXML, USS, UIDocument, PanelSettings, VisualElement, stylesheet, design token, CSS variable, flex, flexbox, flex-direction, runtime UI, EditorWindow UI, ScaleWithScreenSize, ConstantPixelSize, scaleMode, 界面工具包, UI样式, 样式表, 可视化元素, 弹性布局, 编辑器窗口, 设计令牌.
Unity UI Toolkit Skills
Use this module for Unity UI Toolkit only: UXML for structure, USS for styling, UIDocument for scene attachment, and PanelSettings for runtime rendering.
Requires Unity 2022.3+. Do not mix this module with ui_* UGUI/Canvas skills.
Localization: Match visible UI text to the user's language. Chinese conversation -> Chinese labels/placeholders/button text. USS class names and CSS variables stay English.
ScaleWithScreenSize: default for runtime HUD/menu UI
ConstantPixelSize: use when strict pixel mapping matters
ConstantPhysicalSize: rare; only for physically sized UI requirements
Unity 6 world-space flows also need the scene-side document camera setup after configuring PanelSettings.
File and Structure Rules
Prefer one UXML root that references shared token/style files through <Style src="..."/>.
Keep USS next to UXML when possible so relative style references stay short.
Use uitk_inspect_uxml before complex structural edits if you did not create the file yourself.
uitk_create_uxml can auto-reference a stylesheet when ussPath is provided.
Workflow Notes
Create USS/UXML first, then attach them through uitk_create_document.
Runtime rendering needs a valid PanelSettings asset.
When USS and UXML are in the same folder, prefer <Style src="MyStyle.uss" />; use a full asset path only for cross-folder references.
Start with design tokens, then component rules, then layout containers.
For incremental edits, prefer uitk_read_file -> edit -> uitk_write_file.
When creating 2+ files, use uitk_create_batch.
Unity 6 world-space rendering uses PanelSettings world-space options plus the scene-side UIDocument camera setup.
Use uitk_create_from_template when the user needs a starter screen fast; use uitk_add_element / uitk_add_uss_rule for targeted edits on existing files.
Exact names, parameters, defaults, and returns are defined by GET /skills/schema or unity_skills.get_skill_schema(), not by this file.
Load USS_REFERENCE.md before generating non-trivial USS systems, layout patterns, component styles, or complete examples.