我的顺风背景梯度没有被应用
下面是我的html代码:
<div>
<button className="bg-gradient-to-r from-primary-orange via-secondary-orange to-lighter-orange w-4/5 p-4 mt-10 rounded">Search Flights</button>
</div>我的tailwind.config.js:
module.exports = {
purge: [],
darkMode: false, // or 'media' or 'class'
theme: {
backgroundColor: theme => ({
...theme('colors'),
'primary-orange': '#FF8C00',
'secondary-orange':'#FFA500',
'lighter-orange':'#FFD700'
})
},
variants: {
extend: {},
},
plugins: [],
}使用后css运行我的react脚本,以便在生成后css而不是渐变之后,我添加到tailwind.config中的所有其他颜色都可以工作。
知道为什么吗?
谢谢
发布于 2021-01-24 22:39:02
如果您想扩展默认调色板而不是覆盖它,请使用tailwind.config.js文件的extend部分。然后将gradientColorStops属性添加到其中,您可以在其中编写自定义颜色。
module.exports = {
purge: [],
darkMode: false,
theme: {
extend: {
gradientColorStops: theme => ({
'primary': '#FF8C00',
'secondary': '#FFA500',
'danger': '#FFD700',
}),
},
},
variants: {
extend: {},
},
plugins: [],
}https://stackoverflow.com/questions/65868238
复制相似问题