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

Colors: no keywords or non-Hex/Rgb values #1

Open
frykten opened this issue Dec 30, 2021 · 1 comment
Open

Colors: no keywords or non-Hex/Rgb values #1

frykten opened this issue Dec 30, 2021 · 1 comment

Comments

@frykten
Copy link

frykten commented Dec 30, 2021

We're trying to go from Tachyons to Tailwind and tried your codemod. There were plenty of issues with gradients and borders with multiple colors, combinations, and stuff, why not. But this one seems... Quite restrictive. I see that they're using chroma which has this forsaken issue: gka/chroma.js#280

Did you have a fix or a workaround? (I guess apart from just copy/pasting the whole of Tachyons and deleting manually all keywords

Error: unknown hex color: unset
    at hex2rgb (/home/fry/concord-workspace/concord-app-front/services/front/node_modules/chroma-js/chroma.js:786:15)
    at new Color (/home/fry/concord-workspace/concord-app-front/services/front/node_modules/chroma-js/chroma.js:177:42)
    at chroma (/home/fry/concord-workspace/concord-app-front/services/front/node_modules/chroma-js/chroma.js:198:13)
    at /home/fry/concord-workspace/concord-app-front/services/front/node_modules/tailwind-mappings/src/color-utils.js:68:29
    at Array.map (<anonymous>)
    at getProximateColor (/home/fry/concord-workspace/concord-app-front/services/front/node_modules/tailwind-mappings/src/color-utils.js:57:6)
    at getColorUtils (/home/fry/concord-workspace/concord-app-front/services/front/node_modules/tailwind-mappings/src/color-utils.js:81:27)
    at getBorderColorUtils (/home/fry/concord-workspace/concord-app-front/services/front/node_modules/tailwind-mappings/src/border-utils.js:57:40)
    at getTailwindUtils (/home/fry/concord-workspace/concord-app-front/services/front/node_modules/tailwind-mappings/src/tailwind-utils.js:50:16)
    at /home/fry/concord-workspace/concord-app-front/services/front/node_modules/ember-tailwind-codemod/transforms/tailwind/index.js:47:20
@rajasegar
Copy link
Owner

@frykten I am afraid if it is a limitation with chroma.js there is not much we can do about it. But we can definitely handle special cases like this in this codemod, let me check and get back

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants