-
Notifications
You must be signed in to change notification settings - Fork 0
/
tailwind.config.js
36 lines (33 loc) · 940 Bytes
/
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
/* eslint-disable @typescript-eslint/no-var-requires */
const { fontFamily } = require('tailwindcss/defaultTheme');
const withOpacity =
(variable) =>
({ opacityValue }) =>
opacityValue === undefined
? `rgb(var(${variable}))`
: `rgb(var(${variable}) / ${opacityValue})`;
const getColorShades = (shades, name = 'primary') =>
shades.reduce(
(a, v) => ({ ...a, [v]: withOpacity(`--tw-clr-${name}-${v}`) }),
{}
);
/** @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: [],
};