【发布时间】:2021-06-27 17:14:42
【问题描述】:
这是我的 tailwind.config.js:
const colors = require('tailwindcss/colors')
module.exports = {
purge: {
content: ['./pages/**/*.{js,jsx,ts,tsx}', './src/**/*.{js,jsx,ts,tsx}'],
},
theme: {
colors: {
'BASE_YELLOW': '#C9FB5C',
'black': '000',
},
},
variants: {},
plugins: [],
}
还有我的 React 组件 div:
<div className="w-full min-h-screen flex items-center justify-center bg-gradient-to-r from-colors.BASE_YELLOW to-colors.black ...">
但屏幕只是灰色的。如何在渐变中使用这些颜色?
【问题讨论】:
标签: reactjs tailwind-css