Skip to content

@usemotif/tokens default theme ships no borderWidths or letterSpacings scales, but style props reference them #13

@0xNeit

Description

@0xNeit

Summary

@usemotif/core defines borderWidths and letterSpacings as token scales, and several style props resolve against them — but the default @usemotif/tokens theme provides no values for either. A $token reference for those props therefore cannot resolve against the shipped defaults.

Details

  • Schema declares both scales: packages/core/src/types.ts:54 (letterSpacings?: TokenScale<…>), :57 (borderWidths?: TokenScale<…>), and the TokenScaleName union at :124 / :127.
  • Style props are bound to them in packages/core/src/style-props.ts:
    • borderWidth, borderTopWidth, borderRightWidth, borderBottomWidth, borderLeftWidth → scale borderWidths (lines 140-145)
    • letterSpacing → scale letterSpacings (line 160)
  • packages/tokens/src/themes.ts (the shipped light + dark themes) defines colors and the other scales but neither borderWidths nor letterSpacings (grep -n "letterSpacings\|borderWidths" packages/tokens/src/themes.ts → no matches).

Impact

<Box borderWidth="$borderWidths.thin" /> or letterSpacing="$letterSpacings.tight" has nothing to resolve against for any project on the default token set. Authors must hand-add the scales or fall back to raw values — undercutting the "adopt Motif with zero token authoring" promise.

Suggested fix

  • Add default borderWidths (e.g. none / hairline / thin / thick) and letterSpacings (e.g. tighter / tight / normal / wide) scales to the light + dark themes in packages/tokens/src/themes.ts.
  • packages/tokens/src/validation/m3.ts already synthesizes a letterSpacings map for Material-3 validation — reconcile the key names so the two agree.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High severity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions