2021-02-26 11:57:44 +00:00
|
|
|
const colors = require('tailwindcss/colors')
|
|
|
|
|
2022-10-12 02:54:11 +00:00
|
|
|
function exposeColorsToCssVars ({ addBase, theme }) {
|
|
|
|
function extractColorVars (colorObj, colorGroup = '') {
|
2022-10-07 03:54:06 +00:00
|
|
|
return Object.keys(colorObj).reduce((vars, colorKey) => {
|
2022-10-10 04:18:53 +00:00
|
|
|
const value = colorObj[colorKey]
|
2022-10-07 03:54:06 +00:00
|
|
|
|
|
|
|
const newVars =
|
|
|
|
typeof value === 'string'
|
|
|
|
? { [`--color${colorGroup}-${colorKey}`]: value }
|
2022-10-10 04:18:53 +00:00
|
|
|
: extractColorVars(value, `-${colorKey}`)
|
2022-10-07 03:54:06 +00:00
|
|
|
|
2022-10-10 04:18:53 +00:00
|
|
|
return { ...vars, ...newVars }
|
|
|
|
}, {})
|
2022-10-07 03:54:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
addBase({
|
|
|
|
':root': extractColorVars(theme('colors')),
|
2022-10-10 04:18:53 +00:00
|
|
|
})
|
2022-10-07 03:54:06 +00:00
|
|
|
}
|
|
|
|
|
2020-04-17 07:12:26 +00:00
|
|
|
module.exports = {
|
2020-12-13 04:43:36 +00:00
|
|
|
darkMode: 'class',
|
2022-10-10 04:18:53 +00:00
|
|
|
content: [
|
|
|
|
'./src/**/*.js',
|
|
|
|
'./src/**/*.cljs',
|
|
|
|
'./resources/**/*.html'
|
|
|
|
],
|
|
|
|
safelist: [
|
2022-10-12 03:14:31 +00:00
|
|
|
'bg-black', 'bg-white',
|
|
|
|
{ pattern: /bg-(gray|red|yellow|green|blue|orange|indigo|rose|purple|pink)-(100|200|300|400|500|600|700|800|900)/ },
|
|
|
|
{ pattern: /text-(gray|red|yellow|green|blue|orange|indigo|rose|purple|pink)-(100|200|300|400|500|600|700|800|900)/ }
|
2022-10-10 04:18:53 +00:00
|
|
|
],
|
|
|
|
plugins: [
|
|
|
|
require('@tailwindcss/forms'),
|
|
|
|
require('@tailwindcss/typography'),
|
|
|
|
require('@tailwindcss/aspect-ratio'),
|
|
|
|
exposeColorsToCssVars
|
|
|
|
],
|
2021-02-26 11:57:44 +00:00
|
|
|
theme: {
|
2021-07-12 13:57:53 +00:00
|
|
|
extend: {
|
2022-10-07 03:54:06 +00:00
|
|
|
fontSize: {
|
|
|
|
'2xs': ['0.625rem', '0.875rem']
|
|
|
|
},
|
2021-09-13 11:49:51 +00:00
|
|
|
animation: {
|
|
|
|
'spin-reverse': 'spin 2s linear infinite reverse',
|
|
|
|
},
|
2021-07-12 13:57:53 +00:00
|
|
|
spacing: {
|
|
|
|
'128': '32rem',
|
2021-07-15 07:29:44 +00:00
|
|
|
'144': '36rem'
|
2021-09-13 11:49:51 +00:00
|
|
|
},
|
|
|
|
scale: {
|
|
|
|
'200': '2',
|
|
|
|
'250': '2.5',
|
|
|
|
'300': '3',
|
|
|
|
'400': '4',
|
2021-07-12 13:57:53 +00:00
|
|
|
}
|
|
|
|
},
|
2021-02-26 11:57:44 +00:00
|
|
|
colors: {
|
|
|
|
transparent: 'transparent',
|
|
|
|
current: 'currentColor',
|
|
|
|
black: colors.black,
|
|
|
|
white: colors.white,
|
2022-10-12 02:54:11 +00:00
|
|
|
gray: colors.neutral,
|
2021-03-02 03:57:23 +00:00
|
|
|
green: colors.green,
|
2021-03-03 07:07:36 +00:00
|
|
|
blue: colors.blue,
|
2021-02-26 11:57:44 +00:00
|
|
|
indigo: {
|
|
|
|
50: '#f0f9ff',
|
|
|
|
100: '#e0f2fe',
|
|
|
|
200: '#bae6fd',
|
|
|
|
300: '#7dd3fc',
|
|
|
|
400: '#38bdf8',
|
|
|
|
500: '#0ea5e9',
|
|
|
|
600: '#0284c7',
|
|
|
|
700: '#005b8a',
|
|
|
|
800: '#075985',
|
|
|
|
900: '#0c4a6e',
|
|
|
|
},
|
2021-03-05 06:15:37 +00:00
|
|
|
red: colors.red,
|
2021-02-26 11:57:44 +00:00
|
|
|
yellow: colors.amber,
|
|
|
|
orange: colors.orange,
|
2022-10-07 03:54:06 +00:00
|
|
|
rose: colors.rose,
|
|
|
|
purple: colors.purple,
|
|
|
|
pink: colors.pink
|
2021-02-26 11:57:44 +00:00
|
|
|
}
|
|
|
|
}
|
2020-12-13 04:43:36 +00:00
|
|
|
}
|