Vixen
dd8b0a81
csharp
public static class ControlTheme

The stylesheet the controls come with.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Loaded as UserAgent, which is the whole design. A game's own stylesheet is Author and beats this at equal specificity, so restyling a button is one rule rather than a fork of this file — and a rule that only names button is enough, rather than one that has to out-specify whatever this happened to write. That is the reason the cascade has three origins, and this is the first thing in the engine to use the first of them.

⚠ Colours go through custom properties and geometry does not. A theme wanting different colours sets nine values on the root; one wanting different shapes writes rules, because there is no useful token for "a switch's knob is a circle". The split is where it is because recolouring is what nearly every application does and reshaping is what a few do thoroughly.

⚠ The layout defaults are CSS's, so a container with no flex-direction is a row — LayoutStyleBuilder starts from CSS's initial values rather than from Yoga's, which differ in four places. Every rule below that wants a column therefore says so, and a rule that reads as redundant beside a browser stylesheet is not.

box-sizing: border-box is set here on everything, which is the one place it can be: LayoutStyleBuilder's own remarks say the property belongs in a user-agent stylesheet where an author can see and override it rather than baked into the bridge where they cannot. This is that stylesheet. Without it a control's declared height is the height of its content and every padded control comes out taller than it says.

Fields and properties (1)

  • public static string Css

    The stylesheet's text, for a caller that wants to read or amend it.

Methods (1)

  • public static int Install(UiDocument document)

    Loads the theme into a document.

Used by (40)

  • DocumentBenchmarksVixen.Benchmarks.Ui
  • EditorShellSceneVixen.Benchmarks.Ui
  • AdvancedFixtureVixen.Ui.Controls.Advanced.Tests
  • CodeCaretBlinkTestsVixen.Ui.Controls.Advanced.Tests
  • ControlFixtureVixen.Ui.Controls.Tests
  • ControlHarnessVixen.Ui.Controls.Tests
  • DiagnosticsPanelTestsVixen.Ui.Controls.Tests
  • DialogTestsVixen.Ui.Controls.Tests
  • DocumentClosePromptTestsVixen.Ui.Controls.Tests
  • ThemeAccentTokenTestsVixen.Ui.Controls.Tests
  • UiApplicationVixen.Ui.Desktop
  • UtilityGenerationTestsVixen.Ui.Styling.Utilities.Tests
  • BlockoutUvViewTestsVixen.Editor.Blockout.Tests
  • BrushInspectorMarkupTestsVixen.Editor.Terrain.Tests
  • CommandTestsVixen.Editor.Ui.Tests
  • ConsoleViewTestsVixen.Editor.Ui.Tests
  • DrawerTestsVixen.Editor.Inspector.Tests
  • EditorShellVixen.Editor.Ui
  • FactBlockTestsVixen.Editor.Terrain.Tests
  • FactRowTestsVixen.Editor.Ui.Tests
  • FlameChartViewTestsVixen.Editor.Profiler.Tests
  • InspectorFixtureVixen.Editor.Inspector.Tests
  • KeyBindingsViewTestsVixen.Editor.Ui.Tests
  • MarkupPanelTestsVixen.Editor.Profiler.Tests
  • MenuTestsVixen.Editor.Ui.Tests
  • NetworkViewTestsVixen.Editor.Debugger.Tests
  • PaletteBlockTestsVixen.Editor.Terrain.Tests
  • PlatformKeyTestsVixen.Editor.Ui.Tests
  • PortedPanelTestsVixen.Editor.Debugger.Tests
  • ScopeTestsVixen.Editor.Ui.Tests
  • SelfHandlerKeyTestsVixen.Editor.Ui.Tests
  • ServiceTestsVixen.Editor.Ui.Tests
  • StackedPanelScrollTestsVixen.Editor.Terrain.Tests
  • TaskCenterTestsVixen.Editor.Ui.Tests
  • ToolbarBindingTestsVixen.Editor.Ui.Tests
  • ToolbarSectionTestsVixen.Editor.Ui.Tests
  • ViewFixtureVixen.Editor.NodeGraph.Tests
  • ViewHarnessVixen.Editor.AssetEditors.Tests
  • WaterFactsTestsVixen.Editor.Water.Tests
  • WorkspaceTestsVixen.Editor.Ui.Tests