Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linear gradients do not work with color modifier transform #325

Open
darylthornhill opened this issue Oct 29, 2024 · 1 comment
Open

Linear gradients do not work with color modifier transform #325

darylthornhill opened this issue Oct 29, 2024 · 1 comment
Assignees
Labels
question Question about sd-transforms/style-dictionary

Comments

@darylthornhill
Copy link

What happened?

When using the `ts/color/modifiers' plugin, and using a gradient in a token we get the error

`TypeError: Could not parse linear-gradient(90deg, #535353 12.8%, #434343 62.47%) as a color. Missing a plugin?

Temporarily im using patch-package to get around it just for looking for linear-gradient in the value string and exiting early. But other people may get this same issue.

Reproduction

just put the linear-gradient as a value of a color

e.g. click here for the configurator link

Expected output

Just for the gradient to use

Version

1.2.6

@darylthornhill darylthornhill added bug Something isn't working triage To be reproduced as bug labels Oct 29, 2024
@jorenbroekema
Copy link
Member

jorenbroekema commented Nov 1, 2024

The expected output isn't clear to me, do you expect it to darken every color element within the linear-gradient? Or just don't modify it and return without throwing an error? Wouldn't that mean the color modification isn't happening; that seems undesirable to me as well.

This is former behavior is not supported but I suppose it could be a feature request if we wanted this. The latter (just ignoring) is also fine by me but it should at least throw some kind of warning otherwise the "exiting early" and not doing the color modification may go unnoticed.

@jorenbroekema jorenbroekema added question Question about sd-transforms/style-dictionary and removed bug Something isn't working triage To be reproduced as bug labels Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question about sd-transforms/style-dictionary
Projects
None yet
Development

No branches or pull requests

2 participants