-
Notifications
You must be signed in to change notification settings - Fork 1
/
tailwind.config.js
92 lines (89 loc) · 2.75 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/* eslint-disable no-undef */
/* eslint-disable @typescript-eslint/no-var-requires */
const colors = require('tailwindcss/colors');
const defaultTheme = require('tailwindcss/defaultTheme');
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./index.html', './src/**/*.{ts,tsx}'],
theme: {
colors: {
...colors,
transparent: 'transparent',
current: 'currentColor',
error: '#dc2626',
'error-selected': '#fbe9e9',
'error-light': colors.red[200],
success: '#16a34a',
'success-light': '#dcfce7',
brand: {
DEFAULT: addOpacity('var(--brand)'),
dark: addAlphaValue('var(--brand-dark)'),
light: addAlphaValue('var(--brand-light)'),
lighter: addAlphaValue('var(--brand-lighter)'),
},
primary: {
DEFAULT: addOpacity('var(--primary)'),
dark: addAlphaValue('var(--primary-dark)'),
light: addAlphaValue('var(--primary-light)'),
},
contract: addOpacity('var(--contract)'),
highlight: addOpacity('var(--highlight)'),
checkbox: {
DEFAULT: 'var(--border-default)',
checked: addAlphaValue('var(--primary-light)'),
},
header: {
light: addAlphaValue('var(--header-light)'),
DEFAULT: addAlphaValue('var(--header)'),
dark: addAlphaValue('var(--header-dark)'),
},
default: {
light: addAlphaValue('var(--default-light)'),
DEFAULT: addAlphaValue('var(--default)'),
dark: addAlphaValue('var(--default-dark)'),
},
layer0: addAlphaValue('var(--layer0)'),
layer1: addAlphaValue('var(--layer1)'),
},
textColor: theme => {
return {
...theme('colors'),
header: {
light: addAlphaValue('var(--text-header-light)'),
DEFAULT: addAlphaValue('var(--text-header)'),
dark: addAlphaValue('var(--text-header-dark)'),
},
default: {
light: addAlphaValue('var(--text-default-light)'),
DEFAULT: addAlphaValue('var(--text-default)'),
dark: addAlphaValue('var(--text-default-dark)'),
},
disabled: {
DEFAULT: addAlphaValue('var(--text-disabled)'),
},
};
},
borderColor: theme => ({
...theme('colors'),
header: {
DEFAULT: addAlphaValue('var(--border-header)'),
},
default: {
DEFAULT: addAlphaValue('var(--border-default)'),
},
}),
extend: {
fontFamily: {
sans: ['Inter var', 'Inter', ...defaultTheme.fontFamily.sans],
mono: ['IBM Plex Mono', ...defaultTheme.fontFamily.mono],
},
},
},
plugins: [],
};
function addAlphaValue(variable) {
return variable;
}
function addOpacity(variable) {
return `rgb(${variable} / <alpha-value>)`;
}