You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
920 B
40 lines
920 B
const colors = require('tailwindcss/colors');
|
|
|
|
/** @type {import('tailwindcss').Config} */
|
|
module.exports = {
|
|
content: ['./src/**/*.{html,js,svelte,ts}'],
|
|
theme: {
|
|
extend: {
|
|
colors: {
|
|
text: '#c1b492',
|
|
accent: '#d2738a',
|
|
card: '#1a1a1a',
|
|
bg: colors.zinc
|
|
}
|
|
}
|
|
},
|
|
plugins: [
|
|
function ({ addBase, theme }) {
|
|
function extractColorVars(colorObj, colorGroup = '') {
|
|
return Object.keys(colorObj).reduce((vars, colorKey) => {
|
|
const value = colorObj[colorKey];
|
|
const cssVariable =
|
|
colorKey === 'DEFAULT' ? `--color${colorGroup}` : `--color${colorGroup}-${colorKey}`;
|
|
|
|
const newVars =
|
|
typeof value === 'string'
|
|
? { [cssVariable]: value }
|
|
: extractColorVars(value, `-${colorKey}`);
|
|
|
|
return { ...vars, ...newVars };
|
|
}, {});
|
|
}
|
|
|
|
addBase({
|
|
':root': extractColorVars(theme('colors'))
|
|
});
|
|
},
|
|
require('@tailwindcss/typography')
|
|
]
|
|
};
|