Skip to content

Commit f806aed

Browse files
committed
Removed Tailwind dependency from ShadCN package
1 parent ee9bd36 commit f806aed

File tree

9 files changed

+141
-159
lines changed

9 files changed

+141
-159
lines changed

packages/shadcn/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@
7474
"lucide-react": "^0.525.0",
7575
"react-hook-form": "^7.54.2",
7676
"tailwind-merge": "^2.3.0",
77-
"tailwindcss": "^4.1.12",
78-
"tw-animate-css": "^1.3.7",
7977
"zod": "^3.24.2"
8078
},
8179
"devDependencies": {

packages/shadcn/src/lib/utils.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
import { type ClassValue, clsx } from "clsx";
2-
import { extendTailwindMerge } from "tailwind-merge";
3-
4-
// Ensures that `bn-` prefixed Tailwind classes are recognized as Tailwind
5-
// classes, so they can be merged correctly.
6-
const twMerge = extendTailwindMerge({
7-
prefix: "bn-",
8-
});
1+
import { clsx, type ClassValue } from "clsx";
2+
import { twMerge } from "tailwind-merge";
93

104
export function cn(...inputs: ClassValue[]) {
115
return twMerge(clsx(inputs));

packages/shadcn/src/style.css

Lines changed: 0 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -1,128 +1,5 @@
1-
@import "tailwindcss";
2-
@import "tw-animate-css";
31
@import "@blocknote/react/style.css";
42

5-
@custom-variant dark (&:is(.dark *));
6-
7-
:root {
8-
--background: oklch(1 0 0);
9-
--foreground: oklch(0.145 0 0);
10-
--card: oklch(1 0 0);
11-
--card-foreground: oklch(0.145 0 0);
12-
--popover: oklch(1 0 0);
13-
--popover-foreground: oklch(0.145 0 0);
14-
--primary: oklch(0.205 0 0);
15-
--primary-foreground: oklch(0.985 0 0);
16-
--secondary: oklch(0.97 0 0);
17-
--secondary-foreground: oklch(0.205 0 0);
18-
--muted: oklch(0.97 0 0);
19-
--muted-foreground: oklch(0.556 0 0);
20-
--accent: oklch(0.97 0 0);
21-
--accent-foreground: oklch(0.205 0 0);
22-
--destructive: oklch(0.577 0.245 27.325);
23-
--destructive-foreground: oklch(0.577 0.245 27.325);
24-
--border: oklch(0.922 0 0);
25-
--input: oklch(0.922 0 0);
26-
--ring: oklch(0.708 0 0);
27-
--chart-1: oklch(0.646 0.222 41.116);
28-
--chart-2: oklch(0.6 0.118 184.704);
29-
--chart-3: oklch(0.398 0.07 227.392);
30-
--chart-4: oklch(0.828 0.189 84.429);
31-
--chart-5: oklch(0.769 0.188 70.08);
32-
--radius: 0.625rem;
33-
--sidebar: oklch(0.985 0 0);
34-
--sidebar-foreground: oklch(0.145 0 0);
35-
--sidebar-primary: oklch(0.205 0 0);
36-
--sidebar-primary-foreground: oklch(0.985 0 0);
37-
--sidebar-accent: oklch(0.97 0 0);
38-
--sidebar-accent-foreground: oklch(0.205 0 0);
39-
--sidebar-border: oklch(0.922 0 0);
40-
--sidebar-ring: oklch(0.708 0 0);
41-
}
42-
43-
.dark {
44-
--background: oklch(0.145 0 0);
45-
--foreground: oklch(0.985 0 0);
46-
--card: oklch(0.145 0 0);
47-
--card-foreground: oklch(0.985 0 0);
48-
--popover: oklch(0.145 0 0);
49-
--popover-foreground: oklch(0.985 0 0);
50-
--primary: oklch(0.985 0 0);
51-
--primary-foreground: oklch(0.205 0 0);
52-
--secondary: oklch(0.269 0 0);
53-
--secondary-foreground: oklch(0.985 0 0);
54-
--muted: oklch(0.269 0 0);
55-
--muted-foreground: oklch(0.708 0 0);
56-
--accent: oklch(0.269 0 0);
57-
--accent-foreground: oklch(0.985 0 0);
58-
--destructive: oklch(0.396 0.141 25.723);
59-
--destructive-foreground: oklch(0.637 0.237 25.331);
60-
--border: oklch(0.269 0 0);
61-
--input: oklch(0.269 0 0);
62-
--ring: oklch(0.439 0 0);
63-
--chart-1: oklch(0.488 0.243 264.376);
64-
--chart-2: oklch(0.696 0.17 162.48);
65-
--chart-3: oklch(0.769 0.188 70.08);
66-
--chart-4: oklch(0.627 0.265 303.9);
67-
--chart-5: oklch(0.645 0.246 16.439);
68-
--sidebar: oklch(0.205 0 0);
69-
--sidebar-foreground: oklch(0.985 0 0);
70-
--sidebar-primary: oklch(0.488 0.243 264.376);
71-
--sidebar-primary-foreground: oklch(0.985 0 0);
72-
--sidebar-accent: oklch(0.269 0 0);
73-
--sidebar-accent-foreground: oklch(0.985 0 0);
74-
--sidebar-border: oklch(0.269 0 0);
75-
--sidebar-ring: oklch(0.439 0 0);
76-
}
77-
78-
@theme inline {
79-
--color-background: var(--background);
80-
--color-foreground: var(--foreground);
81-
--color-card: var(--card);
82-
--color-card-foreground: var(--card-foreground);
83-
--color-popover: var(--popover);
84-
--color-popover-foreground: var(--popover-foreground);
85-
--color-primary: var(--primary);
86-
--color-primary-foreground: var(--primary-foreground);
87-
--color-secondary: var(--secondary);
88-
--color-secondary-foreground: var(--secondary-foreground);
89-
--color-muted: var(--muted);
90-
--color-muted-foreground: var(--muted-foreground);
91-
--color-accent: var(--accent);
92-
--color-accent-foreground: var(--accent-foreground);
93-
--color-destructive: var(--destructive);
94-
--color-destructive-foreground: var(--destructive-foreground);
95-
--color-border: var(--border);
96-
--color-input: var(--input);
97-
--color-ring: var(--ring);
98-
--color-chart-1: var(--chart-1);
99-
--color-chart-2: var(--chart-2);
100-
--color-chart-3: var(--chart-3);
101-
--color-chart-4: var(--chart-4);
102-
--color-chart-5: var(--chart-5);
103-
--radius-sm: calc(var(--radius) - 4px);
104-
--radius-md: calc(var(--radius) - 2px);
105-
--radius-lg: var(--radius);
106-
--radius-xl: calc(var(--radius) + 4px);
107-
--color-sidebar: var(--sidebar);
108-
--color-sidebar-foreground: var(--sidebar-foreground);
109-
--color-sidebar-primary: var(--sidebar-primary);
110-
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
111-
--color-sidebar-accent: var(--sidebar-accent);
112-
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
113-
--color-sidebar-border: var(--sidebar-border);
114-
--color-sidebar-ring: var(--sidebar-ring);
115-
}
116-
117-
@layer base {
118-
* {
119-
@apply border-border outline-ring/50;
120-
}
121-
body {
122-
@apply bg-background text-foreground;
123-
}
124-
}
125-
1263
.bn-shadcn svg:not([class*="size-"]) {
1274
width: revert;
1285
height: revert;

playground/components.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "new-york",
4+
"rsc": false,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "",
8+
"css": "src/style.css",
9+
"baseColor": "neutral",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"aliases": {
14+
"components": "@/components",
15+
"utils": "@/lib/utils",
16+
"ui": "@/components/ui",
17+
"lib": "@/lib",
18+
"hooks": "@/hooks"
19+
},
20+
"iconLibrary": "lucide"
21+
}

playground/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,17 @@
5555
"@uppy/xhr-upload": "^3.4.0",
5656
"@y-sweet/react": "^0.6.3",
5757
"ai": "^4.3.15",
58+
"class-variance-authority": "^0.7.1",
59+
"clsx": "^2.1.1",
5860
"docx": "^9.0.2",
61+
"lucide-react": "^0.525.0",
5962
"react": "^19.1.0",
6063
"react-dom": "^19.1.0",
6164
"react-icons": "^5.2.1",
6265
"react-router-dom": "^6.20.0",
66+
"tailwindcss": "^4.1.12",
67+
"tailwind-merge": "^2.6.0",
68+
"tw-animate-css": "^1.3.7",
6369
"y-partykit": "^0.0.25",
6470
"yjs": "^13.6.27",
6571
"zustand": "^5.0.3"
@@ -72,8 +78,6 @@
7278
"eslint": "^8.10.0",
7379
"rimraf": "^5.0.5",
7480
"rollup-plugin-webpack-stats": "^0.2.2",
75-
"tailwindcss": "^4.1.12",
76-
"tailwindcss-animate": "^1.0.7",
7781
"vite": "^6",
7882
"vite-plugin-eslint": "^1.8.1",
7983
"vite-plugin-inspect": "11.1.0"

playground/src/lib/utils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { clsx, type ClassValue } from "clsx"
2+
import { twMerge } from "tailwind-merge"
3+
4+
export function cn(...inputs: ClassValue[]) {
5+
return twMerge(clsx(inputs))
6+
}

playground/src/style.css

Lines changed: 83 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,88 @@
11
@import url("@mantine/core/styles.css");
22
@import "tailwindcss";
3-
@source "../../packages/shadcn/src";
4-
/* @import "tw-animate-css"; */
3+
@import "tw-animate-css";
4+
5+
@custom-variant dark (&:is(.dark *));
6+
7+
@source "../../packages/shadcn";
8+
9+
:root {
10+
--radius: 0.625rem;
11+
--background: oklch(1 0 0);
12+
--foreground: oklch(0.145 0 0);
13+
--card: oklch(1 0 0);
14+
--card-foreground: oklch(0.145 0 0);
15+
--popover: oklch(1 0 0);
16+
--popover-foreground: oklch(0.145 0 0);
17+
--primary: oklch(0.205 0 0);
18+
--primary-foreground: oklch(0.985 0 0);
19+
--secondary: oklch(0.97 0 0);
20+
--secondary-foreground: oklch(0.205 0 0);
21+
--muted: oklch(0.97 0 0);
22+
--muted-foreground: oklch(0.556 0 0);
23+
--accent: oklch(0.97 0 0);
24+
--accent-foreground: oklch(0.205 0 0);
25+
--destructive: oklch(0.577 0.245 27.325);
26+
--border: oklch(0.922 0 0);
27+
--input: oklch(0.922 0 0);
28+
--ring: oklch(0.708 0 0);
29+
--chart-1: oklch(0.646 0.222 41.116);
30+
--chart-2: oklch(0.6 0.118 184.704);
31+
--chart-3: oklch(0.398 0.07 227.392);
32+
--chart-4: oklch(0.828 0.189 84.429);
33+
--chart-5: oklch(0.769 0.188 70.08);
34+
--sidebar: oklch(0.985 0 0);
35+
--sidebar-foreground: oklch(0.145 0 0);
36+
--sidebar-primary: oklch(0.205 0 0);
37+
--sidebar-primary-foreground: oklch(0.985 0 0);
38+
--sidebar-accent: oklch(0.97 0 0);
39+
--sidebar-accent-foreground: oklch(0.205 0 0);
40+
--sidebar-border: oklch(0.922 0 0);
41+
--sidebar-ring: oklch(0.708 0 0);
42+
}
43+
44+
.dark {
45+
--background: oklch(0.145 0 0);
46+
--foreground: oklch(0.985 0 0);
47+
--card: oklch(0.205 0 0);
48+
--card-foreground: oklch(0.985 0 0);
49+
--popover: oklch(0.205 0 0);
50+
--popover-foreground: oklch(0.985 0 0);
51+
--primary: oklch(0.922 0 0);
52+
--primary-foreground: oklch(0.205 0 0);
53+
--secondary: oklch(0.269 0 0);
54+
--secondary-foreground: oklch(0.985 0 0);
55+
--muted: oklch(0.269 0 0);
56+
--muted-foreground: oklch(0.708 0 0);
57+
--accent: oklch(0.269 0 0);
58+
--accent-foreground: oklch(0.985 0 0);
59+
--destructive: oklch(0.704 0.191 22.216);
60+
--border: oklch(1 0 0 / 10%);
61+
--input: oklch(1 0 0 / 15%);
62+
--ring: oklch(0.556 0 0);
63+
--chart-1: oklch(0.488 0.243 264.376);
64+
--chart-2: oklch(0.696 0.17 162.48);
65+
--chart-3: oklch(0.769 0.188 70.08);
66+
--chart-4: oklch(0.627 0.265 303.9);
67+
--chart-5: oklch(0.645 0.246 16.439);
68+
--sidebar: oklch(0.205 0 0);
69+
--sidebar-foreground: oklch(0.985 0 0);
70+
--sidebar-primary: oklch(0.488 0.243 264.376);
71+
--sidebar-primary-foreground: oklch(0.985 0 0);
72+
--sidebar-accent: oklch(0.269 0 0);
73+
--sidebar-accent-foreground: oklch(0.985 0 0);
74+
--sidebar-border: oklch(1 0 0 / 10%);
75+
--sidebar-ring: oklch(0.556 0 0);
76+
}
77+
78+
@layer base {
79+
* {
80+
@apply border-border outline-ring/50;
81+
}
82+
body {
83+
@apply bg-background text-foreground;
84+
}
85+
}
586

687
@theme inline {
788
--color-background: var(--background);

playground/tsconfig.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@
1616
"noEmit": true,
1717
"jsx": "react-jsx",
1818
"composite": true,
19-
"rootDir": ".."
19+
"rootDir": "..",
20+
"baseUrl": ".",
21+
"paths": {
22+
"@/*": ["./src/*"]
23+
}
2024
},
2125
"include": ["src", "../examples", "./vite.config.ts"],
2226
"references": [

pnpm-lock.yaml

Lines changed: 18 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)