tailwindcss-custom-forms icon indicating copy to clipboard operation
tailwindcss-custom-forms copied to clipboard

Error compiling when using 'iconColor' with a custom modifier

Open mohamedsabil83 opened this issue 5 years ago • 2 comments

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>`,
        }
    },
}),

mohamedsabil83 avatar Aug 22 '19 03:08 mohamedsabil83

Having this exact same issue. The suggested workaround works well

jorgebastida avatar Jan 19 '21 10:01 jorgebastida

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

mohamedsabil83 avatar Jan 24 '21 07:01 mohamedsabil83