Skip to content
API reference

theme

Import
import * as api from "@fungi.computer/stipe/theme";
Kind Export Description
type alias StipeTheme One of Stipe’s shipped theme names.
type alias ThemeListener Receives the current theme after a matching attribute mutation.
constant STIPE_THEMES Curated themes shipped by Stipe; hosts may still install their own themes.
constant stipeThemeSchema Decode a shipped theme name at a serialized-data boundary.
function applyTheme() Set the Daisy theme name. Persistence and application policy stay with the host.
function getTheme() Read the Daisy theme name from the root element, when available.
function subscribeTheme() Subscribe to root data-theme mutations without owning browser policy.

StipeThemetype alias

Section titled “StipeTheme”
Signature
type StipeTheme = z.infer<typeof stipeThemeSchema>;

One of Stipe’s shipped theme names.


ThemeListenertype alias

Section titled “ThemeListener”
Signature
type ThemeListener = (theme) => void;

Receives the current theme after a matching attribute mutation.

Parameter Type
theme string

void

STIPE_THEMESconstant

Section titled “STIPE_THEMES”
Signature
const STIPE_THEMES: readonly [
"light",
"dark",
"latte",
"mocha",
"readout",
"readout-night",
"field-guide",
"field-guide-night",
"embed",
"embed-dark",
"phosphor",
"codec",
"paper",
"ember",
"tide",
"tape",
"sunrise",
"pirate-radio",
"pirate-radio-night",
"consulting",
"consulting-ink",
"consulting-night",
"consulting-night-ink",
"consulting-riso-latte",
"consulting-riso-latte-ink",
"consulting-riso-glomzy",
"consulting-riso-glomzy-ink",
"vishnu",
"coin",
"coin-night",
"chamfer",
];

Curated themes shipped by Stipe; hosts may still install their own themes.


stipeThemeSchemaconstant

Section titled “stipeThemeSchema”
Signature
const stipeThemeSchema: ZodEnum<{
codec: "codec";
embed: "embed";
embed-dark: "embed-dark";
readout: "readout";
readout-night: "readout-night";
latte: "latte";
mocha: "mocha";
light: "light";
dark: "dark";
field-guide: "field-guide";
field-guide-night: "field-guide-night";
phosphor: "phosphor";
paper: "paper";
ember: "ember";
tide: "tide";
tape: "tape";
sunrise: "sunrise";
pirate-radio: "pirate-radio";
pirate-radio-night: "pirate-radio-night";
consulting: "consulting";
consulting-ink: "consulting-ink";
consulting-night: "consulting-night";
consulting-night-ink: "consulting-night-ink";
consulting-riso-latte: "consulting-riso-latte";
consulting-riso-latte-ink: "consulting-riso-latte-ink";
consulting-riso-glomzy: "consulting-riso-glomzy";
consulting-riso-glomzy-ink: "consulting-riso-glomzy-ink";
vishnu: "vishnu";
coin: "coin";
coin-night: "coin-night";
chamfer: "chamfer";
}>;

Decode a shipped theme name at a serialized-data boundary.

applyTheme()function

Section titled “applyTheme()”
Signature
function applyTheme(theme, root?): void;

Set the Daisy theme name. Persistence and application policy stay with the host.

Parameter Type
theme string
root? HTMLElement

void


Signature
function getTheme(root?): string | null;

Read the Daisy theme name from the root element, when available.

Parameter Type
root? HTMLElement

string | null


subscribeTheme()function

Section titled “subscribeTheme()”
Signature
function subscribeTheme(listener, root?): () => void;

Subscribe to root data-theme mutations without owning browser policy.

Parameter Type
listener ThemeListener
root? HTMLElement

() => void