-- Auto-generated by rbx-css
-- Source: themes.css
local function createStyleSheet()
local sheet = Instance.new("StyleSheet")
sheet.Name = "StyleSheet"
-- Base theme tokens
sheet:SetAttribute("bg", Color3.fromRGB(255, 255, 255))
sheet:SetAttribute("surface", Color3.fromRGB(245, 245, 245))
sheet:SetAttribute("text", Color3.fromRGB(26, 26, 46))
sheet:SetAttribute("text-secondary", Color3.fromRGB(102, 102, 102))
sheet:SetAttribute("primary", Color3.fromRGB(51, 95, 255))
sheet:SetAttribute("border", Color3.fromRGB(0, 0, 0))
sheet:SetAttribute("radius", UDim.new(0, 8))
-- Design rules (using token references)
do
local rule = Instance.new("StyleRule")
rule.Selector = "Frame"
rule.Parent = sheet
rule:SetProperties({
BackgroundColor3 = "$bg",
BackgroundTransparency = 0,
})
end
do
local rule = Instance.new("StyleRule")
rule.Selector = ".card"
rule.Parent = sheet
rule:SetProperties({
BackgroundColor3 = "$surface",
BackgroundTransparency = 0,
})
end
do
local rule = Instance.new("StyleRule")
rule.Selector = ".card::UICorner"
rule.Parent = sheet
rule:SetProperty("CornerRadius", "$radius")
end
do
local rule = Instance.new("StyleRule")
rule.Selector = ".card::UIStroke"
rule.Parent = sheet
rule:SetProperties({
Thickness = 1,
Color = "$border",
Transparency = 0.9,
ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
})
end
do
local rule = Instance.new("StyleRule")
rule.Selector = ".card::UIPadding"
rule.Parent = sheet
rule:SetProperties({
PaddingTop = UDim.new(0, 20),
PaddingBottom = UDim.new(0, 20),
PaddingLeft = UDim.new(0, 20),
PaddingRight = UDim.new(0, 20),
})
end
do
local rule = Instance.new("StyleRule")
rule.Selector = ".card > TextLabel"
rule.Parent = sheet
rule:SetProperties({
TextColor3 = "$text",
TextSize = 16,
FontFace = Font.new("rbxasset://fonts/families/GothamSSm.json"),
})
end
do
local rule = Instance.new("StyleRule")
rule.Selector = "TextButton"
rule.Parent = sheet
rule:SetProperties({
BackgroundColor3 = "$primary",
BackgroundTransparency = 0,
TextColor3 = Color3.fromRGB(255, 255, 255),
TextSize = 14,
FontFace = Font.new(
"rbxasset://fonts/families/GothamSSm.json",
Enum.FontWeight.SemiBold
),
})
end
do
local rule = Instance.new("StyleRule")
rule.Selector = "TextButton::UICorner"
rule.Parent = sheet
rule:SetProperty("CornerRadius", "$radius")
end
do
local rule = Instance.new("StyleRule")
rule.Selector = "TextButton:Hover"
rule.Parent = sheet
rule:SetProperties({
BackgroundColor3 = Color3.fromRGB(45, 80, 221),
})
end
-- Theme system
local themes = {}
-- Dark theme
do
local theme = Instance.new("StyleSheet")
theme.Name = "StyleSheet_dark"
-- Override tokens
theme:SetAttribute("bg", Color3.fromRGB(26, 26, 46))
theme:SetAttribute("surface", Color3.fromRGB(37, 37, 69))
theme:SetAttribute("text", Color3.fromRGB(225, 225, 225))
theme:SetAttribute("text-secondary", Color3.fromRGB(160, 160, 160))
theme:SetAttribute("primary", Color3.fromRGB(68, 112, 255))
theme:SetAttribute("border", Color3.fromRGB(255, 255, 255))
themes["dark"] = theme
end
-- StyleDerive for theme switching
local themeDerive = Instance.new("StyleDerive")
themeDerive.StyleSheet = sheet
themeDerive.Parent = sheet
-- Theme setter function
local function setTheme(themeName: string)
local theme = themes[themeName]
if theme then
themeDerive.StyleSheet = theme
else
warn("Unknown theme: " .. themeName)
end
end
return sheet, setTheme, themes
end
return createStyleSheet