我想对我的背景图像应用线性渐变。在 tailwind 配置文件上,我写了一个自定义规则,如下所示:
theme: {
extend: {
backgroundImage: (theme) => ({
'hero-pattern': "url('../src/images/icon-bg.jpg')",
}),
},
},
有用。但是当我尝试应用线性渐变时,它并没有起作用。
对于应用线性渐变,我尝试过的是:
theme: {
extend: {
backgroundImage: (theme) => ({
'hero-pattern':
"linear-gradient(to right bottom, rgba('#7ed56f',0.8), rgba('#28b485',0.8)), url('../src/images/icon-bg.jpg')",
}),
},
},
但它没有用。