Skip to content

Commit

Permalink
fix: Add transparent value for colors with alpha as 0
Browse files Browse the repository at this point in the history
  • Loading branch information
RayRedGoose committed Apr 18, 2024
1 parent 620bf1b commit 0d5532f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/canvas-tokens/utils/transformers/flatRGBAColor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const flatRGBAColor = ({value}: DesignToken): string => {
const innerRgb = b.replace(/rgba\(([^}]+)/g, (__: string, c: string) =>
c.split(',').slice(0, 3).toString()
);
return `rgba(${innerRgb},${alpha})`;
return alpha === '0' ? 'transparent' : `rgba(${innerRgb},${alpha})`;
});

return rgba;
Expand Down

0 comments on commit 0d5532f

Please sign in to comment.