Skip to content
Roblox API Reference

StyleRule

Defines style properties which override properties on the instances affected by the Selector property.
Memory category
Gui
Own members
18
Inherited members
79
Subclasses
0
Siblings
2

Properties29

Inherited fromObject2

Property categoryData

Inherited fromInstance21

Property categoryBehavior

Property categoryData

Property categoryPermissions

Defined byStyleRule6

Property categoryData

  • StyleRule.Index: number = -1
    • Hidden
    • Not scriptable
    • Capabilities: UI
    • Load only
  • StyleRule.Priority: number = 0
    A number that determines how properties of the StyleRule apply relative to the same properties in other StyleRules. Higher priority values take precedence over lower.
    • Capabilities: UI
  • StyleRule.PropertiesSerialize: string = ""
    • Hidden
    • Not scriptable
    • Capabilities: UI
  • StyleRule.PropertyTransitionsSerialize: string = "\u0002"
    • Hidden
    • Not scriptable
    • Capabilities: UI
  • StyleRule.Selector: string = ""
    A string specifying which instances the StyleRule should affect.
    • Capabilities: UI
  • StyleRule.SelectorError: string = ""
    A read-only string that displays errors from the Selector property.
    • Read only
    • Capabilities: UI

Methods56

Inherited fromObject3
  • Get an event that fires when a given property of the object changes.
    Parameters
    ParameterDescription
    property: string
    The property to connect to.
    Returns
    TypeDescription
    RBXScriptSignal
    A signal that fires whenever the property changes.
  • Object:IsA(className: string): boolean
    Returns true if an object's class matches or inherits from a given class.
    • Custom Lua state
    • Thread safe
    Parameters
    ParameterDescription
    className: string
    The class against which the Object's class will be checked. Case-sensitive.
    Returns
    TypeDescription
    boolean
    Describes whether the Object's class matched or is a subclass of the given class.
  • Object:isA(className: string): boolean
    Deprecated: This deprecated function is a variant of Object:IsA() which should be used instead.
    • Deprecated
    • Custom Lua state
    Parameters
    Parameter
    className: string
    Returns
    Type
    boolean

    Use IsA instead.

Inherited fromInstance39
Inherited fromStyleBase3
Defined byStyleRule11
  • StyleRule:GetDefaultPropertyTransition(): any
    Returns the default transition applied to all properties of the StyleRule that don't have an explicit transition set.
    • Capabilities: UI
    Returns
    TypeDescription
    any
    The default transition as a TweenInfo or string token, or nil if no default transition is set.
  • StyleRule:GetProperties(): { [string]: any }
    Returns a dictionary of key-value pairs describing the properties of the StyleRule.
    • Capabilities: UI
    Returns
    TypeDescription
    { [string]: any }
    Dictionary of key-value pairs describing the properties of the StyleRule.
  • StyleRule:GetPropertiesResolved(): { [string]: any }
    • Roblox script security
    • Capabilities: UI
  • StyleRule:GetProperty(name: string): any
    Returns the value of a specific property in the StyleRule.
    • Capabilities: UI
    Parameters
    ParameterDescription
    name: string
    String name of the property, for example "AnchorPoint" or "BackgroundColor3".
    Returns
    TypeDescription
    any
    Value of the property.
  • StyleRule:GetPropertyResolved(name: string): any
    • Roblox script security
    • Capabilities: UI
    Parameters
    Parameter
    name: string
    Returns
    Type
    any
  • StyleRule:GetPropertyTransitions(): { [string]: any }
    Returns a dictionary of all property transitions set on the StyleRule.
    • Capabilities: UI
    Returns
    TypeDescription
    { [string]: any }
    Dictionary of key-value pairs mapping property names to their transition parameters.
  • StyleRule:SetDefaultPropertyTransition(transitionParams: any)
    Sets or clears a default transition that applies to all properties of the StyleRule that don't have an explicit transition set.
    • Capabilities: UI
    Parameters
    ParameterDescription
    transitionParams: any
    Either a TweenInfo, a token string defining the default transition timing, or nil to remove the default transition.
  • StyleRule:SetProperties(styleProperties: { [string]: any })
    Lets you declare and set multiple properties of the StyleRule at once.
    • Capabilities: UI
    Parameters
    ParameterDescription
    styleProperties: { [string]: any }
    Dictionary of key-value pairs defining the properties to set.
  • StyleRule:SetProperty(name: string, value: any)
    Sets or updates a single property of the StyleRule.
    • Capabilities: UI
    Parameters
    ParameterDescription
    name: string
    Property name to set, for example "BackgroundColor3".
    value: any
    Property value to set, for example Color3.new(1, 0, 0.25).
  • StyleRule:SetPropertyTransition(property: string, transitionParams: any)
    Sets or clears the transition for a single property on the StyleRule.
    • Capabilities: UI
    Parameters
    ParameterDescription
    property: string
    String name of the property to set a transition for, for example "BackgroundColor3" or "Size".
    transitionParams: any
    A TweenInfo or token string defining the transition timing, or nil to remove the transition for this property.
  • StyleRule:SetPropertyTransitions(properties: { [string]: any })
    Lets you declare and set transitions for multiple properties of the StyleRule at once.
    • Capabilities: UI
    Parameters
    ParameterDescription
    properties: { [string]: any }
    Dictionary of property names to transition parameters.

Events12

Inherited fromObject1
Inherited fromInstance9
Inherited fromStyleBase1
Defined byStyleRule1
  • StyleRule.StyleRulePropertyChanged: RBXScriptSignal<(styleProperty: string)>
    • Roblox script security
    • Capabilities: UI
    Parameters
    Parameter
    styleProperty: string