Skip to content

Class Skin ​

Source: skin.ts

Determines the look and feel of ProzillaOS by overriding content, layout and style.

Individual components may also specify their own overrides for any given skin by using the useSkinOverrides hook.

Apps can also dynamically change their data based on the current skin, using App.setSkinOverrides or App.addSkinOverride.

Example ​

ts
// Skin with a custom wallpaper
const wallpaperSkin = new Skin({
	defaultWallpaper: "/assets/wallpapers/very-cool-wallpaper.png",
});

// Skin with custom CSS
const customCssSkin = new Skin({
	loadStyleSheet: () => { void import("./skin.css"); },
});

Extended by ​

Constructors ​

Constructor ​

new Skin(options?: Partial<SkinOptions>): Skin

Parameters ​

options? ​

Partial<SkinOptions> = {}

Returns ​

Skin

Properties ​

baseUrl ​

baseUrl: string


systemIcon ​

systemIcon: string


appIcons ​

appIcons: {[key: string]: string; } | undefined


appNames ​

appNames: {[key: string]: string; } | undefined


wallpapers ​

wallpapers: string[]


defaultWallpaper ​

defaultWallpaper: string


fileIcons ​

fileIcons: { generic: string; info?: string; text?: string; code?: string; external?: string; video?: string; audio?: string; }

generic ​

generic: string

info? ​

optional info?: string

text? ​

optional text?: string

code? ​

optional code?: string

external? ​

optional external?: string

video? ​

optional video?: string

audio? ​

optional audio?: string


folderIcons ​

folderIcons: { generic: string; images?: string; text?: string; link?: string; video?: string; audio?: string; }

generic ​

generic: string

images? ​

optional images?: string

text? ​

optional text?: string

optional link?: string

video? ​

optional video?: string

audio? ​

optional audio?: string


loadStyleSheet ​

loadStyleSheet: (() => void) | undefined


defaultTheme ​

defaultTheme: Theme | undefined


TEMPLATE_KEYS ​

readonly static TEMPLATE_KEYS: { baseUrl: "base"; }

baseUrl ​

readonly baseUrl: "base" = "base"

Template key that will be replaced by Skin.baseUrl.


DEFAULTS ​

static DEFAULTS: SkinOptions

The default options for this skin.

Methods ​

resolveAssetUrls() ​

Call Signature ​

resolveAssetUrls<Assets>(assets: Assets): Assets

Type Parameters ​
Assets ​

Assets extends Record<string, string>

Parameters ​
assets ​

Assets

Returns ​

Assets

Call Signature ​

resolveAssetUrls(assets: string[]): string[]

Parameters ​
assets ​

string[]

Returns ​

string[]


resolveAssetUrl() ​

resolveAssetUrl(assetUrl: string): string

Parameters ​

assetUrl ​

string

Returns ​

string


assetUrl() ​

static assetUrl(url: string): string

Prepends Skin.TEMPLATE_KEYS.baseUrl to the URL, if it is a relative URL.

This makes the URL automatically adapt to the value of Skin.baseUrl when it is used as a value of a property in SkinOptions that specifies the URL to an asset (e.g., SkinOptions.systemIcon).

Parameters ​

url ​

string

The URL of the asset.

Returns ​

string

Built by Prozilla