Figma plugin theming with CSS variables, light/dark mode support, semantic color tokens, and UI design system libraries.
figma.showUI(__html__, { themeColors: true });
This injects into the UI iframe:
figma-light or figma-dark class on <html><style id="figma-style"> with CSS variablesbody {
background-color: var(--figma-color-bg);
color: var(--figma-color-text);
font-family: 'Inter', sans-serif;
font-size: 11px;
margin: 0;
padding: 8px;
}
button {
background: var(--figma-color-bg-brand);
color: var(--figma-color-text-onbrand);
border: none;
border-radius: 6px;
padding: 8px 16px;
cursor: pointer;
font-size: 11px;
}