Theming & Skins
WHIP's colours, fonts, radii, shadows and spacing are CSS custom properties in whip_core/html/css/base.css. A skin is a resource of its own, an fxmanifest.lua and a theme.css that overrides them, so it survives every whip_core update.
Turning a skin on
- Standing theme:
Config.Theme = 'your_theme_resource'in whip_core's config, the server's permanent look. - Runtime skin: a resource that calls
SetActiveTheme.startreskins every connected client live;stopreverts.
The full contract (every token, your own fonts, partial themes, what's locked) is whip_core/docs/nui-theming.md. Beside it, nui-architecture.md covers how the NUI modules talk to the client scripts, and nui-inventory.md how to replace the inventory's renderer outright.
Sets, or clears with nil, the server-wide theme over Config.Theme. It belongs to the resource that set it (the registration rule): only it can change it, a second skin is refused, and when it stops the look reverts to Config.Theme. Connected clients swap live, late joiners get it on login, and a misnamed resource logs to F8 and falls back to the base look.
| Param | Type | Description |
|---|---|---|
| resource | string|nil | The resource whose theme.css to apply, usually your own. nil clears it (only for the resource that set it) |
bool ok, string|nil err: false, 'the active theme belongs to X — stop it first' when another resource's skin is active-- A complete skin's server.lua (fxmanifest.lua: shared_script '@whip_core/lib/satellite.lua')
Whip.register(function()
exports.whip_core:SetActiveTheme('my_skin')
end)
Whip.register, not at file scope. The override dies with whip_core on a restart, and Whip.register runs again then. At file scope your skin vanishes after the first restart whip_core.Which theme is in force, and who set it.
string|nil theme, string|nil owner: the resource whose theme.css applies and the one that set it. With no override, Config.Theme (nil for the stock look) and no ownerlocal theme, owner = exports.whip_core:GetActiveTheme()
print(('theme %s, set by %s'):format(tostring(theme), owner or 'config.lua'))