module.exports = { darkMode:'class', // Enable dark mode based on class theme: { extend: { colors: { // Global button colors button: {DEFAULT: '#a31319', // Default button backgroundcolor (light mode) dark:'#4a0000', // Dark button backgroundcolor (dark mode) textLight:'#ffffff', // Button textcolor in light mode textDark: '#e63946', // Button textcolor in dark mode hover: '#e63946', // Button hover color for light mode hoverDark: '#9b0000',// Button hover color for dark mode}, }, backgroundImage: { 'btn-gradient-light':'linear-gradient(to right, #a31319, #000000)', // Light mode gradient'btn-gradient-dark': 'linear-gradient(to right, #000000, #a31319)', // Dark mode gradient} } }, plugins: [],};
<!-- Button with text color based on light and dark mode --> <button class="bg-gradientRedToBlack text-button-textLight py-2px-4rounded-lg hover:bg-gradientBlackToRed dark:bg-gradientBlackToRed dark:text-button-textDark dark:hover:bg-gradientRedToBlack"> Submit </button>