Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


StyleSheet

Style sheets are applied to visual elements in order to control the layout and visual appearance of the user interface.
Read time 4 minutesLast updated 4 days ago

Definition

[HelpURL("UIE-USS")]public class StyleSheet : ScriptableObject

Remarks

The StyleSheet class holds the imported data of USS files in your project. Once loaded, a style sheet can be attached to a VisualElement object to affect the element itself and its descendants.

Examples

public class MyEditorWindow : EditorWindow{ void OnEnable() { rootVisualElement.styleSheets.Add(AssetDatabase.LoadAssetAtPath<StyleSheet>("Assets/styles.uss")); }}

Properties

Property

Description

contentHashA hash value computed from the stylesheet content.
importedWithErrorsWhether there were errors encountered while importing the StyleSheet
importedWithWarningsWhether there were warnings encountered while importing the StyleSheet

Inheritance

Inherited Members

Operators

Operator

Description

operator ==Compares two object references to see if they refer to the same object.
boolDetermines whether the object exists.
operator !=Compares if two objects refer to a different object.