evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a small view that demonstrates runtime theme switching, unstyled mode fallback, and pass-through customization using the UI library's theming system.
export type ThemeProfile = {
name: string;
tokens: Record<string, string>;
};
export type PassThroughSection = {
class?: string | string[] | Record<string, boolean>;
style?: Record<string, string>;
attrs?: Record<string, string>;
};
export type ComponentPassThrough = {
button?: {
root?: PassThroughSection;
label?: PassThroughSection;
icon?: PassThroughSection;
};
};
export interface ThemePlaygroundOptions {
mount: HTMLElement;
profiles: ThemeProfile[];
defaultProfile: string;
passThrough?: ComponentPassThrough;
unstyled?: boolean;
}
export interface ThemePlayground {
currentProfile(): string;
switchProfile(name: string): void;
setUnstyled(value: boolean): void;
updatePassThrough(options: ComponentPassThrough): void;
}
export function createThemePlayground(options: ThemePlaygroundOptions): ThemePlayground;Provides theme tokens, unstyled mode flag, and per-component pass-through customization. @satisfied-by