Skip to content

Extensions reference

Every key Scalar writes into $extensions. A standard build ignores all of them and still comes out correct; they’re for custom transforms, audits and re-importing into Figma.

There are two kinds:

  • com.figma.*: facts read straight from Figma, unchanged. Values use Figma’s own names (UPPER, FONT_SIZE, LINEAR), as in the Figma plugin API.
  • ext.scalar: one object holding what Scalar worked out or kept for you, usually a reference that couldn’t go in $value.

Keys only appear when they have something to say: a text style with no underline has no underline keys.

Stability: these key names and their meanings don’t change without a note in Scalar’s changelog.

Key Value When
com.figma.variableId The variable’s Figma ID. Always.
com.figma.collectionId Its collection’s Figma ID. Always.
com.figma.scopes The variable’s scopes, e.g. ["FONT_SIZE"]. When it has any. Use it to tell text sizes from other sizes (see Android).
com.figma.codeSyntax Figma’s code syntax names, e.g. { "WEB": "--blue-500" }. When set in Figma.
com.figma.hiddenFromPublishing true When the variable is hidden from publishing.
com.figma.name The original Figma name. When the name had to change for the output (spaces, { } . ;).
Key Value When
com.figma.rawValue The value as it was in Figma. When it was converted: an opacity on 0–100 (40 → 0.4), or a boolean.
com.figma.type "boolean" On a boolean variable. DTCG has no boolean type, so it’s exported as a number: 1 for true, 0 for false.
com.figma.composedColor The base color (a reference or a color) and the separate opacity (a number or a reference). On a color with its own opacity, which is exported flattened. See Known limitations.
Key Value When
com.figma.styleId The style’s Figma ID. Always (on every style).
com.figma.name The original Figma name. When it had to change.
com.figma.fontStyle Figma’s style name, e.g. "SemiBold Italic". Always. The only place italic is recorded.
com.figma.textCase UPPER, LOWER, TITLE, SMALL_CAPS, … When not the default.
com.figma.textDecoration UNDERLINE or STRIKETHROUGH When set.
com.figma.textDecorationStyle WAVY or DOTTED Underline style, when not solid.
com.figma.textDecorationOffset { "value": 2, "unit": "PIXELS" } (or PERCENT) When not Auto.
com.figma.textDecorationThickness Same shape as the offset. When not Auto.
com.figma.textDecorationColor A DTCG color object. When not Auto.
com.figma.textDecorationSkipInk false When skip ink is off.
com.figma.paragraphSpacing A number, in px. When not 0.
com.figma.paragraphIndent A number, in px. When not 0.
com.figma.listSpacing A number, in px. When not 0.
com.figma.hangingPunctuation true When on.
com.figma.hangingList true When on.
com.figma.leadingTrim CAP_HEIGHT When set.
com.figma.textWrapStyle BALANCE or PRETTY When not Auto.
com.figma.rawValue { "lineHeight": …, "letterSpacing": … } with Figma’s original value and unit. When a line height or letter spacing was converted (px or Auto line height, % letter spacing).

And in ext.scalar, the variables a style was bound to where the value itself couldn’t hold the reference:

Key Value When
boundLineHeight A reference, e.g. "{font.line-height.24}" Line height bound to a variable (exported as a multiplier instead).
boundFontStyle A reference Weight bound through a text (font style) variable (exported as a number instead).
boundParagraphSpacing A reference Paragraph spacing bound to a variable.
boundParagraphIndent A reference Paragraph indent bound to a variable.
boundTextDecorationColor A reference Underline color bound to a variable.
Key Value When
com.figma.styleId The style’s Figma ID. Always.
com.figma.name The original Figma name. When it had to change.
com.figma.gradientType LINEAR, RADIAL, ANGULAR or DIAMOND On a gradient. DTCG gradients are stops only, so the type lives here.
com.figma.gradientTransform Figma’s 2×3 gradient matrix. On a gradient. Its direction and position.

These sit on the resolver’s sets and modifiers, and are mainly what Scalar uses to recognize its own files when syncing.

Key Value Where
com.figma.collectionId The collection’s Figma ID (scalar:… for style files). Each set and modifier.
com.figma.collectionKey The collection’s library key. Each collection’s set or modifier, when Figma provides one.
com.figma.modeId A map from mode name to Figma mode ID. Each modifier, or a set whose modes all have the same values.
ext.scalar.styleKeySample A sample of the styles’ library keys. The style sets, when Figma provides keys.