Quick answer: Attach the StyleSheet to the UXML in UI Builder (not just opened in the editor), or add it in code with rootVisualElement.styleSheets.Add.

A UI Toolkit menu looks styled in UI Builder but renders unstyled in the build. The USS was only loaded in the editor, never attached to the document.

Attach in UI Builder

Open the UXML in UI Builder. In the StyleSheets panel, click + and add your .uss. This writes a <Style src="..."/> reference into the UXML so it ships and applies automatically.

“Opening” a USS in UI Builder to preview is not the same as attaching it — previewing doesn’t persist.

Attach in Code

[SerializeField] StyleSheet themeStyle;

void OnEnable()
{
    var root = GetComponent<UIDocument>().rootVisualElement;
    root.styleSheets.Add(themeStyle);
}

Useful for theme-swapping at runtime — add/remove StyleSheets to switch themes.

PanelSettings Theme

The UIDocument’s PanelSettings has a Theme Style Sheet (a .tss). Global styles go there. If your USS depends on the theme, ensure the PanelSettings references the right .tss.

Selector Specificity

If some styles apply but others don’t, it’s specificity. An inline style or a more-specific selector overrides yours. Inspect with the UI Toolkit Debugger (Window → UI Toolkit → Debugger).

Verifying

Build and run. The menu is fully styled. Runtime theme swaps apply. UI Toolkit Debugger shows your USS in the matched styles list.

“Preview is not attach. Add the StyleSheet to the UXML or via code so it ships.”

Keep one base theme .tss in PanelSettings and per-screen .uss attached to each UXML — clean separation, predictable cascade.