Skip to content

Commit

Permalink
Merge pull request #3251 from tokens-studio/fix-linear-gradient-in-co…
Browse files Browse the repository at this point in the history
…mposition-token

Fix linear gradient in composition token
  • Loading branch information
akshay-gupta7 authored Feb 5, 2025
2 parents f6eedbc + b87340e commit 1a07536
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/popular-rabbits-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tokens-studio/figma-plugin": patch
---

Fixes an issue where a user is unable to apply a linear gradient fill via a composition token.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ const applyPaintIfNotEqual = (key, existingPaint, newPaint, target) => {
};

const getLinearGradientPaint = async (fallbackValue, token) => {
const { gradientStops, gradientTransform } = convertStringToFigmaGradient(fallbackValue);
const gradientString = typeof fallbackValue === 'object' && fallbackValue.fill
? fallbackValue.fill
: fallbackValue;
const { gradientStops, gradientTransform } = convertStringToFigmaGradient(gradientString);

const rawValue = defaultTokenValueRetriever.get(token)?.rawValue;
let gradientStopsWithReferences = gradientStops;
Expand Down

0 comments on commit 1a07536

Please sign in to comment.