Skip to content

Plugin Fails to Export Resolved Values When a Referenced Set is Marked "Reference Only" in a Theme #3682

@keeganedwin

Description

@keeganedwin

Describe the bug
When a theme contains a set marked as reference only, the plugin fails to correctly resolve and export token values that depend on it. Instead of exporting the resolved value, it removes the base variable during a cleanup, leaving other variables with broken references.

This occurs in the following scenario:

  1. A token in an active set (e.g., ⁠theme/color.consuming) references a token from a global set (e.g., ⁠global/color.reference with value ⁠#0f0).
  2. A theme is created with both sets enabled. Exporting this correctly creates a base variable (⁠test/color/reference) and a themed variable (⁠test/color/consuming) that references the base.
  3. The user then changes the global set's role in the theme from enabled to reference only.
  4. The user re-exports using the options Remove styles and variables without connection to a token.
  5. The plugin incorrectly removes the base variable (⁠test/color/reference), causing the themed variable (⁠test/color/consuming) to become broken.

To Reproduce
Steps to reproduce the behavior:

  • Provided in the Test File

Expected behavior
When a set is marked as "reference only" within a theme, the plugin should automatically export the resolved (or "raw") value for any tokens that reference it.

Screenshots or Screencasts
https://github.com/user-attachments/assets/4c9de4dc-7a98-4b35-916e-001dbecc8eaa

Figma file (optional)
TEST FILE

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    📥 Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions