StyleBase
The base class for StyleSheet and StyleRule. Holds a list of child StyleRules, as well as token definitions which are stored as attributes.
Summary
Methods
Returns an array of associated StyleRules.
Inserts a new StyleRule into the array of rules.
Similar to InsertStyleRule() but lets you declare and set multiple StyleRules at once.
Events
Fires when one or more StyleRules is explicitly changed on the connected StyleSheet or StyleRule.
Properties
Methods
GetStyleRules
Returns an array of associated StyleRules.
Returns
Array of StyleRules.
InsertStyleRule
Inserts a new StyleRule into the array of rules so that its Priority is greater than all previous StyleRules. If priority is specified, sets the new rule's Priority to the specified value.
Parameters
Returns
SetStyleRules
Similar to InsertStyleRule() but lets you declare and set multiple StyleRules at once.
local ReplicatedStorage = game:GetService("ReplicatedStorage")local coreSheet = Instance.new("StyleSheet")coreSheet.Name = "CoreSheet"coreSheet.Parent = ReplicatedStoragelocal styleRuleA = Instance.new("StyleRule")styleRuleA.Selector = "Frame"styleRuleA:SetProperty("BackgroundColor3", Color3.new(1, 0, 0))local styleRuleB = Instance.new("StyleRule")styleRuleB.Selector = "Frame"styleRuleB:SetProperty("BackgroundColor3", Color3.new(0, 1, 0))coreSheet:SetStyleRules({ styleRuleA, styleRuleB })
Parameters
Array of StyleRules to set.
Returns
Events
StyleRulesChanged
Fires when one or more StyleRules is explicitly changed on the connected StyleSheet or StyleRule, for example when InsertStyleRule() is called.