generated from LordRonz/nextjs-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tailwind.config.js
40 lines (37 loc) · 1.02 KB
/
tailwind.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* eslint-disable @typescript-eslint/no-var-requires */
const { fontFamily } = require('tailwindcss/defaultTheme');
const withOpacity = (variableName) => {
return ({ opacityValue }) => {
if (opacityValue !== undefined) {
return `rgba(var(${variableName}), ${opacityValue})`;
}
return `rgb(var(${variableName}))`;
};
};
const getColorShades = (shades, name = 'primary') => {
const colorShades = {};
shades.forEach((shade) => {
colorShades[shade] = withOpacity(`--tw-clr-${name}-${shade}`);
});
return colorShades;
};
/** @type {import("@types/tailwindcss/tailwind-config").TailwindConfig } */
module.exports = {
content: ['./src/**/*.{js,jsx,ts,tsx}'],
darkMode: 'class', // or 'media' or 'class'
theme: {
extend: {
fontFamily: {
primary: ['Roboto', ...fontFamily.sans],
},
colors: {
// Customize it on globals.css :root
primary: getColorShades([50, 100, 200, 300, 400, 500, 600, 700]),
},
},
},
variants: {
extend: {},
},
plugins: [],
};