Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,8 @@ export class FigmaPluginNode extends PluginNode {
const gradient = value as Gradient;
paint = gradientToGradientPaint(gradient);
}
} else if (value && typeof value === "string" && value === "transparent") {
paint = SOLID_TRANSPARENT;
} else {
throw `unexpected value at paintColor: ${typeof value}, ${value}, ${target}`;
}
Expand Down
6 changes: 5 additions & 1 deletion packages/adaptive-ui-designer-figma-plugin/src/ui/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ function tokenOrGroupStyles(tokenOrGroup: AdaptiveDesignTokenOrGroup, tokenTypes
null;
}

function appliedStyleProperties(tokenTypes: StyleProperty[], tokenIntendedFor: StyleProperty[]): StyleProperty[] {
return tokenTypes.filter(element => tokenIntendedFor.includes(element));
}

const appliedTokensTemplate = (
tokenTypes: StyleProperty[],
tokens: AppliedDesignTokenItem[] | null,
Expand Down Expand Up @@ -150,7 +154,7 @@ const availableTokensTemplate = (
:styles=${x => tokenOrGroupStyles(x, tokenTypes)}
glyphType=${(_) => glyphType}
content-button
@itemClick=${(x, c) => c.parent.controller.styles.applyDesignToken(x.intendedFor || [], x)}
@itemClick=${(x, c) => c.parent.controller.styles.applyDesignToken(appliedStyleProperties(tokenTypes, x.intendedFor), x)}
>
</designer-style-token-item>
`
Expand Down
Loading