-
Notifications
You must be signed in to change notification settings - Fork 0
/
tailwind.config.js
135 lines (133 loc) · 3.85 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
const colors = require('tailwindcss/colors');
const plugin = require('tailwindcss/plugin');
/** @type {import('tailwindcss').Config} */
const tailwindcssConfig = {
content: ['./src/**/*.{js,ts,jsx,tsx}'],
darkMode: 'class',
theme: {
extend: {
colors: {
primary: { ...colors.violet, DEFAULT: colors.violet[500] },
},
cursor: {
auto: 'var(--cursor-auto)',
crosshair: 'var(--cursor-crosshair)',
pointer: 'var(--cursor-pointer)',
grab: 'var(--cursor-grab)',
grabbing: 'var(--cursor-grabbing)',
},
typography: ({ theme }) => ({
DEFAULT: {
css: {
a: {
textDecoration: 'none',
'&:hover': {
color: theme('colors.primary.700'),
},
'.dark &:hover': {
color: theme('colors.primary.300'),
},
},
code: {
margin: '0 4px',
padding: '2px 4px',
borderRadius: '4px',
background: '#1e1e1e',
color: '#ff8888',
},
li: {
a: {
margin: 0,
},
},
'code::before': { content: '' },
'code::after': { content: '' },
},
},
}),
},
},
plugins: [
require('@tailwindcss/typography'),
plugin(({ addBase, addComponents, addUtilities, theme }) => {
addBase({
'a, button': {
cursor: theme('cursor.pointer'),
},
'.top-header-height': {
top: `var(--header-height)`,
},
});
addComponents({
'.bg-lattice': {
'--lattice-base-color': theme('colors.stone.50'),
'--lattice-line-color': 'rgba(0, 0, 0, 0.04)',
'--lattice-ratio': '10%',
'--lattice-size': '10px 10px',
background: `
linear-gradient(
to left,
var(--lattice-line-color) 0,
var(--lattice-line-color) var(--lattice-ratio),
transparent var(--lattice-ratio),
transparent 100%
),
linear-gradient(
to top,
var(--lattice-line-color) 0,
var(--lattice-line-color) var(--lattice-ratio),
transparent var(--lattice-ratio),
transparent 100%
),
var(--lattice-base-color);`,
backgroundSize: 'var(--lattice-size);',
},
'.dark .bg-lattice': {
'--lattice-base-color': theme('colors.stone.950'),
'--lattice-line-color': 'rgba(255, 255, 255, 0.04)',
},
});
addComponents({
'.neon-box': {
'--neon-color': '35, 35, 35',
background: `
linear-gradient(
to top,
rgba(var(--neon-color), .1) 0,
transparent 30%,
transparent 100%
)`,
boxShadow: `
0 0 1px rgba(var(--neon-color), .8),
0 1px 3px rgba(var(--neon-color), .2)`,
},
'.dark .neon-box': {
'--neon-color': '220, 220, 220',
},
'.neon-text': {
'--neon-color': theme('colors.primary.400'),
textShadow: '0 0 .125em var(--neon-color)',
},
'.dark .neon-text': {
'--neon-color': theme('colors.primary.600'),
},
});
addUtilities({
'.multiline-ellipsis': {
overflow: 'hidden',
display: '-webkit-box',
'-webkit-box-orient': 'vertical',
'-webkit-line-clamp': 'var(--webkit-line-clamp, 2)',
},
});
[3, 4, 5].forEach((number) => {
addUtilities({
[`.multiline-ellipsis-${number}`]: {
'--webkit-line-clamp': String(number),
},
});
});
}),
],
};
module.exports = tailwindcssConfig;