Skip to content

Commit cfd1335

Browse files
committed
chore: customize Tailwind color configuration
- Added utility function `omit` to filter out specific UIKit color keys - Removed default UIKit color palette from Tailwind configuration - Maintained custom color definitions for border, sidebar, and muted colors Signed-off-by: Innei <[email protected]>
1 parent 44d8378 commit cfd1335

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

tailwind.config.ts

+23-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,28 @@ import { colors } from 'tailwindcss-uikit-colors/tailwind'
88

99
require('./plugins/css-plugin')
1010

11+
const omit = (obj: Record<string, any>, keys: string[]) => {
12+
return Object.fromEntries(
13+
Object.entries(obj).filter(([key]) => !keys.includes(key)),
14+
)
15+
}
16+
17+
const ignoreUIKitColorKeys = [
18+
'red',
19+
'orange',
20+
'yellow',
21+
'green',
22+
'mint',
23+
'teal',
24+
'cyan',
25+
'blue',
26+
'indigo',
27+
'purple',
28+
'pink',
29+
'brown',
30+
'gray',
31+
]
32+
1133
const twConfig: Config = {
1234
content: ['./src/**/*.{js,jsx,ts,tsx}', './index.html'],
1335
darkMode: ['class', '[data-theme="dark"]'],
@@ -34,7 +56,7 @@ const twConfig: Config = {
3456
},
3557

3658
colors: {
37-
...colors,
59+
...omit(colors, ignoreUIKitColorKeys),
3860
border: 'hsl(var(--border) / <alpha-value>)',
3961
sidebar: 'hsl(var(--sidebar) / <alpha-value>)',
4062
muted: 'hsl(var(--muted) / <alpha-value>)',

0 commit comments

Comments
 (0)