MCPcopy Create free account
hub / github.com/ecomfe/tempad-dev / applyVariableStyle

Function applyVariableStyle

packages/extension/utils/variable-output.ts:67–87  ·  view source on GitHub ↗
(
  style: Record<string, string>,
  node: SceneNode,
  context: VariableProjectionContext,
  format: VariableFormatter,
  readers: FigmaLookupReaders,
  options: VariableStyleOptions = {}
)

Source from the content-addressed store, hash-verified

65}
66
67function applyVariableStyle(
68 style: Record<string, string>,
69 node: SceneNode,
70 context: VariableProjectionContext,
71 format: VariableFormatter,
72 readers: FigmaLookupReaders,
73 options: VariableStyleOptions = {}
74): Record<string, string> {
75 const next = { ...style }
76 const replacements = buildReplacementMap(context, format)
77
78 rewriteKnownCodeSyntaxValues(next, context, format)
79 rewriteInlineVars(next, replacements, options)
80 applyBoundFields(next, node, NODE_VARIABLE_STYLE_PROPS, context, format, readers)
81
82 if (node.type === 'TEXT') {
83 applyTextFields(next, node, context, format, readers)
84 }
85
86 return next
87}
88
89function getCssExprForCodeSyntaxVariable(variable: Variable): string | null {
90 return getVariableCodeSyntax(variable) ? getVariableCssExpr(variable) : null

Callers 3

formatNodeStyleForUiFunction · 0.85
formatNodeStyleForMcpFunction · 0.85

Calls 5

buildReplacementMapFunction · 0.85
rewriteInlineVarsFunction · 0.85
applyBoundFieldsFunction · 0.85
applyTextFieldsFunction · 0.85

Tested by

no test coverage detected