【发布时间】:2021-07-07 08:28:55
【问题描述】:
所以我想用这个tailwindcss插件,我需要自定义颜色。 这是基于tailwindcss docs。
module.exports = {
// ...
plugins: [
require('@gradin/tailwindcss-scrollbar')({
colors: {
track: 'lightgray',
thumb: 'gray',
thumbHover: 'darkgray',
},
}),
],
}
但我想使用主题中的颜色。这两个都不起作用,我仍然得到插件默认配置。
module.exports = {
// ...
plugins: [
require('@gradin/tailwindcss-scrollbar')({
colors: theme => ({
track: theme('colors.gray.200'),
thumb: theme('colors.primary.200'),
thumbHover: theme('colors.primary.500'),
}),
}),
],
}
module.exports = {
// ...
plugins: [
require('@gradin/tailwindcss-scrollbar')(theme => ({
colors: {
track: theme('colors.gray.200'),
thumb: theme('colors.primary.200'),
thumbHover: theme('colors.primary.500'),
},
})),
],
}
【问题讨论】: