Skip to content

Theme

The Theme API allows mods to create and register custom themes, change the active theme at runtime, and inject custom CSS into the game.

Importing

ts
import { Theme } from "@hotbunny/hackhub-content-sdk";

Registering a Theme

Create a custom theme by providing a partial configuration. Any property you don't specify will automatically inherit from the Default (Bear OS) theme.

ts
Theme.register("my-dark-theme", {
    name: "My Dark Theme",
    colors: {
        taskbarBg: "#0a0a0f",
        accentColor: "#e94560",
        windowTitlebar: "#1a1a2e",
        windowBg: "#16213e",
    },
    taskbar: {
        position: "floating",
        borderRadius: "1rem",
        blur: true,
    },
    windows: {
        controlsStyle: "traffic-light",
        controlsPosition: "left",
        borderRadius: "0.75rem",
    },
});

Activating a Theme

ts
Theme.setActive("my-dark-theme");

Getting the Active Theme

ts
const current = Theme.getActive();
console.log(current.id); // "my-dark-theme"
console.log(current.colors.accentColor); // "#e94560"

Listing All Themes

ts
const themes = Theme.getAll();
themes.forEach(t => console.log(t.id, t.name));

Injecting Custom CSS

For advanced customization beyond the config, you can inject raw CSS:

ts
const cssId = Theme.injectCSS(`
    .my-custom-widget {
        background: rgba(0, 0, 0, 0.8);
        border-radius: 12px;
        backdrop-filter: blur(10px);
    }
`);

// Later, remove the injected CSS
Theme.removeCSS(cssId);

ThemeConfig Reference

SectionPropertyTypeDescription
colorstaskbarBgstringTaskbar background color/gradient
controlBarBgstringTop control bar background
windowTitlebarstringWindow titlebar background
windowBgstringWindow content background
accentColorstringAccent color for highlights
desktopIconTextstringDesktop icon label color
startMenuBgstringStart menu background
startMenuTextstringStart menu text color
windowControlsColorstringWindow control buttons color
terminalBgstringTerminal background color
taskbarposition"bottom" | "floating"Taskbar layout mode
heightstringTaskbar height (CSS value)
width"full" | "auto"Full width or auto (for floating)
borderRadiusstringBorder radius
blurbooleanEnable backdrop blur
transparencynumberBackground opacity (0-1)
showSearchbooleanShow search bar in taskbar
showAppNamesbooleanShow app names in taskbar
gapstringGap between taskbar items
paddingstringTaskbar padding
controlBarheightstringTop bar height
blurbooleanEnable backdrop blur
transparencynumberBackground opacity
hasStartMenubooleanRender start menu in control bar
startMenuhost"taskbar" | "controlbar"Where start menu is rendered
borderRadiusstringStart menu border radius
offsetnumberPosition offset in pixels
windowstitlebarHeightstringWindow titlebar height
controlsPosition"left" | "right"Window buttons position
controlsStyle"default" | "traffic-light" | "flat"Window button style
showControlsOnHoverbooleanShow controls only on hover
borderRadiusstringWindow corner radius
blurbooleanEnable window blur effect
desktopiconSizestringDesktop icon size
iconGapstringGap between desktop icons

Notes

  • Theme registration should be done in your Bootstrap.OnModPackageLoaded() method.
  • The player can always switch back to built-in themes from Settings.
  • Mod themes appear alongside built-in themes in the Settings panel.
  • Use injectCSS sparingly — prefer the config properties for most customizations.

HotBunny Interactive Entertainment Inc.