-
Notifications
You must be signed in to change notification settings - Fork 0
/
tailwind.config.js
137 lines (127 loc) · 4.07 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
136
137
const defaultTheme = require("tailwindcss/defaultTheme")
const plugin = require("tailwindcss/plugin");
const scrollbar = plugin(function ({ addUtilities, matchUtilities, theme }) {
const scrollbarTrackColorValue = (value) => ({
'--scrollbar-track': value,
'&::-webkit-scrollbar-track': {
"background-color": value
}
})
const scrollbarTrackRoundedValue = (value) => ({
'&::-webkit-scrollbar-track': {
"border-radius": value
}
});
const scrollbarThumbColorValue = (value) => ({
'--scrollbar-thumb': value,
'&::-webkit-scrollbar-thumb': {
"background-color": value
}
});
const scrollbarThumbRoundedValue = (value) => ({
'&::-webkit-scrollbar-thumb': {
"border-radius": value
}
});
addUtilities({
'.scrollbar': {
'--scrollbar-thumb': '#cdcdcd',
'--scrollbar-track': '#f0f0f0',
'--scrollbar-width': '17px',
'scrollbar-color': 'var(--scrollbar-thumb) var(--scrollbar-track)',
'&::-webkit-scrollbar': {
'width': 'var(--scrollbar-width)'
}
},
'.scrollbar-thin': {
'--scrollbar-width': '8px',
'scrollbar-width': 'thin'
}
});
Object.entries(theme('colors')).forEach(([colorName, color]) => {
switch (typeof color) {
case 'object':
matchUtilities(
{
[`scrollbar-track-${colorName}`]: (value) => (scrollbarTrackColorValue(value)),
[`scrollbar-thumb-${colorName}`]: (value) => (scrollbarThumbColorValue(value))
},
{
values: color
}
)
break;
case 'function':
addUtilities({
[`.scrollbar-track-${colorName}`]: scrollbarTrackColorValue(color({})),
[`.scrollbar-thumb-${colorName}`]: scrollbarThumbColorValue(color({}))
})
break;
case 'string':
addUtilities({
[`.scrollbar-track-${colorName}`]: scrollbarTrackColorValue(color),
[`.scrollbar-thumb-${colorName}`]: scrollbarThumbColorValue(color)
})
break;
}
});
matchUtilities(
{
'scrollbar-track-rounded': (value) => (scrollbarTrackRoundedValue(value)),
'scrollbar-thumb-rounded': (value) => (scrollbarThumbRoundedValue(value))
},
{
values: theme('borderRadius')
}
)
});
module.exports = {
content: [
"./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
"./src/components/**/*.{js,ts,jsx,tsx}",
"./src/layouts/**/*.{js,ts,jsx,tsx}",
"./src/toggles/data/meta.ts",
],
darkMode: "class",
theme: {
extend: {
fontFamily: {
sans: ["Inter", ...defaultTheme.fontFamily.sans],
},
boxShadow: {
"sm-strong": "0 1px 2px 0 rgba(0, 0, 0, 0.25)",
strong:
"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.25)",
"md-strong":
"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.25)",
"lg-strong":
"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.25)",
"xl-strong":
"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.25)",
"2xl-strong": "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
"inner-strong": "inset 0 2px 4px 0 rgba(0, 0, 0, 0.25)",
},
colors: {
dark: {
50: "#383838",
100: "#343434",
200: "#333333",
300: "#2e2e2e",
400: "#2c2c2c",
500: "#272727",
600: "#242424",
700: "#222222",
800: "#1e1e1e",
850: "#171717",
900: "#121212",
},
},
},
screens: {
"2xs": "400px",
xs: "500px",
...defaultTheme.screens,
},
},
plugins: [scrollbar],
}