-
-
Notifications
You must be signed in to change notification settings - Fork 220
Bug: Token reference in baseFontSize no longer resolves per theme during Variables/Styles export #3800
Description
Summary
When a token is referenced in the plugin's baseFontSize setting, it should resolve per theme context during export — allowing different themes to produce different rem→px conversions. This appears to have stopped working in 2.11.0. Instead, all themes now resolve rem values using the currently active theme's baseline, producing identical dimensions across modes.
Blocks responsive typography workflows that rely on per-theme baseFontSize.
Environment
- Plugin version: 2.11.0
- Product area: Plugin Core / Theming / Variables & Styles export
- Last known working version: Pre-2.11.0
Reproduction Steps
- Import the attached token files into the plugin (multi-file setup)
- The
baseFontSizeshould reference a token that resolves differently per theme (e.g.,{typography.baseline}→ 16 for Mobile, 17 for Tablet, 18 for Desktop) - Export Variables and Styles
- Apply a generated text style (e.g.,
body1.normal) to a text element - Switch mode from Mobile to Tablet or Desktop
- Observe: All modes show identical text dimensions
Expected: Each mode should show different text dimensions because 1rem resolves to different px values per theme (16px / 17px / 18px).
Actual: All modes resolve to the same px value — whichever theme is currently active in the plugin.
Token Structure
global.json
├── primitives.typography.baseline-mobile: 16
├── primitives.typography.baseline-tablet: 17
└── primitives.typography.baseline-desktop: 18
device/mobile.json
├── typography.baseline: → {primitives.typography.baseline-mobile}
├── typography.font.size.md: 1rem
└── typography.font.lineHeight.snug: 1.25rem
device/tablet.json
├── typography.baseline: → {primitives.typography.baseline-tablet}
├── typography.font.size.md: 1rem
└── typography.font.lineHeight.snug: 1.25rem
device/desktop.json
├── typography.baseline: → {primitives.typography.baseline-desktop}
├── typography.font.size.md: 1rem
└── typography.font.lineHeight.snug: 1.25rem
components/typography.json
└── typography.styles.body1.normal (typography composite):
fontSize: {typography.font.size.md}
lineHeight: {typography.font.lineHeight.snug}
Themes ($themes.json):
- Mobile → enables: global + device/mobile + components/typography
- Tablet → enables: global + device/tablet + components/typography
- Desktop → enables: global + device/desktop + components/typography
All three themes are in a "Device" group, mapped to a single Figma Variable Collection with three modes.
Investigation Lead
The 2.11.0 release introduced "Smart Defaults" — the plugin now auto-selects the first theme from each group for quicker setup. This change to theme auto-selection/context handling could be affecting how baseFontSize token references are resolved during export. Previously, the export may have resolved the baseFontSize token reference independently per theme context; the new auto-selection behavior might be causing the active theme's resolved value to "leak" into all other theme contexts.
Customer Context
Metadata
Metadata
Assignees
Labels
Type
Projects
Status