此页面暂无简体中文版本,现以英文显示。
Follow the theme in your own UI
Plugin pages and widgets pick up the active theme, light and dark mode and right-to-left layout automatically — if you use tokens.
Whatever theme a workspace chooses, your plugin's pages follow it when you use the design tokens instead of fixed colours. Light and dark themes come from the tokens.
| Purpose | Use |
|---|---|
| Text | text-fg, text-fg-muted, text-fg-subtle |
| Status | text-ok, text-warn, text-danger (plus text or an icon — never colour alone) |
| Surfaces and borders | bg-bg-soft, bg-bg-muted, border-line, cards with className="card" |
| Brand | text-brand, bg-brand-fill |
| Right-to-left | Logical utilities only: ms-, me-, ps-, pe-, text-start, text-end, start-0 |
export function VisitCard({ name, when, late }: { name: string; when: string; late: boolean }) {
return (
<div className="card p-4">
<p className="font-semibold text-fg">{name}</p>
<p className="text-sm text-fg-muted">{when}</p>
{late ? <p className="mt-2 text-sm text-warn ps-2 border-s-2 border-line">Late — call the customer</p> : null}
</div>
);
}- Never hard-code colours (
#ff0000,text-red-600) or physical sides (ml-,left-). - Every page must work at 360 px wide; tables scroll inside their container.
- Admin pages are English; customer-facing plugin strings go through
pluginT(id, locale)withmessages/<locale>.json.
Written from: docs/PLUGIN-DEVELOPER-GUIDE.md, docs/BRAND.md, src/app/globals.css