figma_set_session_defaults
Set design system session defaults: default text fill color, font family, and enforcement mode. Call once after preload_styles to prevent raw black text and enforce DS compliance in strict or permissive mode.
Instructions
Set session-level defaults for DS compliance. Call once at build start after preload_styles. textFillStyleKey sets the default fill for all text nodes that have no explicit fill — prevents raw #000000 black. Pass the DS text-primary color style key. textFillVariable is the alternative for DSs that use variables instead of color styles (e.g., community libraries). Pass one of textFillStyleKey or textFillVariable — not both. fontFamily sets the default font family for all text nodes (default: "Inter"). Set this if your DS uses a different font (e.g., "Roboto", "SF Pro"). dsMode controls DS enforcement: "strict" (default) requires all visual properties to use DS variables/styles — raw hex, raw px, raw fonts are rejected. "permissive" allows raw fallbacks for component-only DSs without published tokens.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| textFillStyleKey | No | DS color style key for text-primary (default text fill). Use for DSs with published color styles. | |
| textFillVariable | No | DS variable path for text-primary (e.g., "text/primary"). Use for DSs that use variables instead of color styles (community libraries). | |
| fontFamily | No | Default font family for text nodes (e.g., "Inter", "Roboto", "SF Pro"). Defaults to "Inter" if not set. | |
| dsMode | No | DS enforcement mode. "strict" (default): all fills, strokes, spacing, radius, and typography must use DS variables/styles — raw values are rejected with an error. "permissive": raw fallbacks allowed for DSs without published tokens. Default: "strict". |