Skip to content

A token reference reaches the Plugin API unresolved on opacity #290

Description

@nathanacurtis
Render failed: in set_opacity: Property "opacity" failed validation: Expected number, received object

The spec carries opacity as a token reference and it is handed to the Plugin API as an object rather than a resolved number, failing the whole render.

Evidence

PagingButton. The value in the spec:

opacity:
  $token: "Constants/Opacity/36"
  $type: number

Other components carry the same shape on root.styles.opacity and round-trip lossily rather than fatally, so this may be specific to how opacity is applied.

Not the same as the dimension-token issue

A sibling issue covers dimension tokens being resolved and then discarded, losing the binding. This one is the opposite: the token is never resolved. Fixing both in one pass risks one change undoing the other.

Where

packages/figma-from-specs/src/Styles/ — opacity handling in StylesApplier. Not identified further.

Fixtures

  • PagingButton — the only fatal case; one component, one property.

Verification

specs render specs/PagingButton --overwrite --page <id> exits 0, and the rendered node's opacity reflects Constants/Opacity/36.

Part of #281.

Metadata

Metadata

Assignees

No one assigned

    Labels

    generatorspecs-from-figma processing engine

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions