-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Cannot convert undefined or null to object #861
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
Comments
The issue comes from I've forked the plugin and added support for 1.x. I don't think it'll work on 0.x but I'll fix it before opening a PR there. In the meantime, you can simply copy and paste this into your plugins and it should work as expected: (function ({
colors,
strategy = 'override',
colorTransform = (color) => color,
} = {}) {
return function ({ addComponents, e, config }) {
if (colors && typeof colors === 'object') {
if (strategy === 'override') {
colors = Object.assign({}, config('theme.colors'), colors)
} else if (strategy === 'replace') {
colors = colors
} else if (strategy === 'extend') {
colors = Object.assign({}, colors, config('theme.colors'))
}
} else {
colors = config('theme.colors')
}
let root = {}
Object.keys(colors).forEach(colorKey => {
root[`--${e(colorKey)}`] = colorTransform(colors[colorKey])
})
addComponents({ ':root': root })
}
})( /* { colors: yourCustomColors } */ ) |
Oh, man! Thanks! |
Done! |
Hi, I use Gridsome and I'm trying upgrade Tailwind to v1.0.0 but I've got an error:
tailwind.config.js
Postcss plugins:
could anyone help me?
thanks
The text was updated successfully, but these errors were encountered: