Theme
Match the look of the community or dashboard your app runs in.
The host tells your app whether it is in light or dark mode, and what it looks like, so your app can match it.
What the host sends
context.theme—"light"or"dark".context.appearance(since@planeward/sdk0.2.6) — the host's look in the current mode:colors— shadcn token names without the--:background,foreground,card,popover,primary,secondary,muted,accent,destructive, each with its-foreground, plusborder,input,ring,chart-1tochart-5and thesidebartokens.radius— the corner radius, such as0.625rem.font—{ family, stylesheets }: a CSSfont-familyvalue and the stylesheets that load it.
Where the values come from:
- In a community channel, they are what the member sees, including the community's Custom CSS.
- On the dashboard, they are Planeward's own colours and the Geist font.
When the viewer switches between light and dark, the host sends the other mode's colours.
Fonts
The community's font and its Google Fonts stylesheet are sent. Fonts uploaded to the community are not, so family falls back to the rest of its stack. Stylesheets are only ever https://fonts.googleapis.com/ URLs.
Apply it
import { applyAppearance, createPlanewardApp } from "@planeward/sdk";
const app = createPlanewardApp();
await app.ready;
applyAppearance(app.context?.appearance);
app.onThemeChange((theme, appearance) => applyAppearance(appearance));applyAppearance sets CSS variables on <html> (--primary, --background, --radius, --font-sans, …) and adds a <link> for each font stylesheet. Calling it again replaces the previous values. It returns a cleanup that removes what it set.
The SDK sanitises the values; anything unknown or unsafe is dropped. If your app has its own look, don't call it.
The app template does this already, in PlanewardThemeSync.
Test it
The planeward dev emulator (CLI 0.1.9 and later) has a Host appearance picker. Choose Planeward default or Sample brand to check that your app re-skins, and switch light and dark to check both modes. See Testing your app.
Planeward Docs