Skip to content
This repository has been archived by the owner on Sep 11, 2021. It is now read-only.

Error compiling when using 'iconColor' with a custom modifier #34

Open
mohamedsabil83 opened this issue Aug 22, 2019 · 2 comments
Open

Comments

@mohamedsabil83
Copy link

Unlike default modifier, if I want to make a new modifier for select with different iconColor, it's must to add icon too or return an error.
eg:

the default modifier (Work)

customForms: theme => ({
    default: {
        select: {
            backgroundColor: theme('colors.white'),
            iconColor: theme('colors.blue.700'),
        }
    },
}),

my light modifier (Not Work)

customForms: theme => ({
    light: {
        select: {
            backgroundColor: theme('colors.white'),
            iconColor: theme('colors.blue.700'),
        }
    },
}),

my light modifier (Work)

customForms: theme => ({
    light: {
        select: {
            backgroundColor: theme('colors.white'),
            iconColor: theme('colors.blue.700'),
            icon: iconColor => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="${iconColor}"><path d="M15.3 9.3a1 1 0 0 1 1.4 1.4l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 0 1 1.4-1.4l3.3 3.29 3.3-3.3z"/></svg>`,
        }
    },
}),
@jorgebastida
Copy link

Having this exact same issue. The suggested workaround works well

@mohamedsabil83
Copy link
Author

Glad that help you. But, when you move to tailwind v2, I advise you to do that, be sure to replace this package with the new one tailwindcss-forms

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

No branches or pull requests

2 participants