I created a custom color on tailwind in next js. On localhost the defined color appears fine, but when I deploy to vercel the color doesn't appear.
here's the picture localhost
production in vercel
tailwind.config.js
const colors = require('tailwindcss/colors');
module.exports = {
purge: [
'./pages/**/*.{js,ts,jsx,tsx}',
'./components/**/*.{js,ts,jsx,tsx}'
],
darkMode: false, // or 'media' or 'class'
theme: {
colors: {
transparent: 'transparent',
current: 'currentColor',
black: {
DEFAULT: '#23232D'
},
white: colors.white,
gray: {
DEFAULT: '#A1A1A1',
},
...
}
},
variants: {
extend: {},
},
plugins: [],
}
ButtonColor/index.js
import PropTypes from 'prop-types';
import { motion } from 'framer-motion';
function ButtonColor({ color, isOpen, onClick }) {
const variants = {
open: { width: '100%' },
closed: { width: '50%' },
}
return (
<motion.div
className={`bg-${color} h-6 cursor-pointer`}
onClick={onClick}
animate={isOpen ? "open" : "closed"}
variants={variants}
>
</motion.div>
)
}
ButtonColor.propTypes = {
color: PropTypes.string.isRequired,
isOpen: PropTypes.bool.isRequired,
onClick: PropTypes.func.isRequired,
}
export default ButtonColor;
Any solutions for this case? thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…