API ReferenceSandbox.UI

StyleSheetCollectionclass

A collection of `Sandbox.UI.StyleSheet` objects applied directly to a panel. See `Sandbox.UI.Panel.StyleSheet`.

objectStyleSheetCollection
Namespace
Sandbox.UI
Assembly
Sandbox.Engine
Declaration
public sealed struct Sandbox.UI.StyleSheetCollection

Methods7

Showing 7 methods

public void Add(Sandbox.UI.StyleSheet sheet)PUBLIC

Add a stylesheet directly

ParameterTypeDescription
sheetStyleSheet
Returns:void

public void AddInline(string content, string key)PUBLIC

Add a stylesheet parsed from a string. The parsed sheet is cached under `key` and shared between all panels using the same key.

ParameterTypeDescription
contentstring
keystring
Returns:void

public System.Collections.Generic.IEnumerable`1<System.ValueTuple`2<string,string>> CollectVariables()PUBLIC

Returns all CSS variables from the owning panel and its ancestors.

Returns:IEnumerable<ValueTuple<string,string>>

public void Load(string filename, bool inheritVariables = True, bool failSilently = False)PUBLIC

Load the stylesheet from a file.

ParameterTypeDescription
filenamestring
inheritVariables = Truebool
failSilently = Falsebool
Returns:void

public void Parse(string stylesheet, bool inheritVariables = True)PUBLIC

Load the stylesheet from a string.

ParameterTypeDescription
stylesheetstring
inheritVariables = Truebool
Returns:void

On this page