Theming
OnyxUI handles theming through a module called Themer
. Themer allows you to customize components throughout OnyxUI, with support for things like colors, corner radiuses, paddings, etc. You'll also probably want to reference it within your own UI for a more consistent design.
Sample themes
Making your own theme
tip
Check out ThemeSpec.luau for a full reference of available theme properties.
Copy the following code into a new "
MyTheme
" modulelocal Themer = OnyxUI.Themer
local Scoped = Fusion.scoped
local Scope = Scoped()
local MyTheme = Themer.NewTheme(Scope, {
-- Specify theme properties here
})
return MyThemeSpecify the properties you want
Use it when constructing your UI
local MyTheme = require(path.to.MyTheme)
local Themer = OnyxUI.Themer
Themer.Theme:is(MyTheme):during(function()
local Theme = Themer.Theme:now() -- This now returns MyTheme!
-- Any UI constructed from this callback will also use MyTheme.
end)