Skip to content

Commit 1c751ca

Browse files
committed
Install shadcn-svelte
1 parent 434b414 commit 1c751ca

File tree

6 files changed

+215
-2
lines changed

6 files changed

+215
-2
lines changed
Lines changed: 119 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,121 @@
11
@import "tailwindcss";
22

3-
@plugin "@tailwindcss/typography";
4-
@plugin "@tailwindcss/forms";
3+
@import "tw-animate-css";
4+
5+
@custom-variant dark (&:is(.dark *));
6+
7+
:root {
8+
--radius: 0.625rem;
9+
--background: oklch(1 0 0);
10+
--foreground: oklch(0.145 0 0);
11+
--card: oklch(1 0 0);
12+
--card-foreground: oklch(0.145 0 0);
13+
--popover: oklch(1 0 0);
14+
--popover-foreground: oklch(0.145 0 0);
15+
--primary: oklch(0.205 0 0);
16+
--primary-foreground: oklch(0.985 0 0);
17+
--secondary: oklch(0.97 0 0);
18+
--secondary-foreground: oklch(0.205 0 0);
19+
--muted: oklch(0.97 0 0);
20+
--muted-foreground: oklch(0.556 0 0);
21+
--accent: oklch(0.97 0 0);
22+
--accent-foreground: oklch(0.205 0 0);
23+
--destructive: 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+
--sidebar: oklch(0.985 0 0);
33+
--sidebar-foreground: oklch(0.145 0 0);
34+
--sidebar-primary: oklch(0.205 0 0);
35+
--sidebar-primary-foreground: oklch(0.985 0 0);
36+
--sidebar-accent: oklch(0.97 0 0);
37+
--sidebar-accent-foreground: oklch(0.205 0 0);
38+
--sidebar-border: oklch(0.922 0 0);
39+
--sidebar-ring: oklch(0.708 0 0);
40+
}
41+
42+
.dark {
43+
--background: oklch(0.145 0 0);
44+
--foreground: oklch(0.985 0 0);
45+
--card: oklch(0.205 0 0);
46+
--card-foreground: oklch(0.985 0 0);
47+
--popover: oklch(0.205 0 0);
48+
--popover-foreground: oklch(0.985 0 0);
49+
--primary: oklch(0.922 0 0);
50+
--primary-foreground: oklch(0.205 0 0);
51+
--secondary: oklch(0.269 0 0);
52+
--secondary-foreground: oklch(0.985 0 0);
53+
--muted: oklch(0.269 0 0);
54+
--muted-foreground: oklch(0.708 0 0);
55+
--accent: oklch(0.269 0 0);
56+
--accent-foreground: oklch(0.985 0 0);
57+
--destructive: oklch(0.704 0.191 22.216);
58+
--border: oklch(1 0 0 / 10%);
59+
--input: oklch(1 0 0 / 15%);
60+
--ring: oklch(0.556 0 0);
61+
--chart-1: oklch(0.488 0.243 264.376);
62+
--chart-2: oklch(0.696 0.17 162.48);
63+
--chart-3: oklch(0.769 0.188 70.08);
64+
--chart-4: oklch(0.627 0.265 303.9);
65+
--chart-5: oklch(0.645 0.246 16.439);
66+
--sidebar: oklch(0.205 0 0);
67+
--sidebar-foreground: oklch(0.985 0 0);
68+
--sidebar-primary: oklch(0.488 0.243 264.376);
69+
--sidebar-primary-foreground: oklch(0.985 0 0);
70+
--sidebar-accent: oklch(0.269 0 0);
71+
--sidebar-accent-foreground: oklch(0.985 0 0);
72+
--sidebar-border: oklch(1 0 0 / 10%);
73+
--sidebar-ring: oklch(0.556 0 0);
74+
}
75+
76+
@theme inline {
77+
--radius-sm: calc(var(--radius) - 4px);
78+
--radius-md: calc(var(--radius) - 2px);
79+
--radius-lg: var(--radius);
80+
--radius-xl: calc(var(--radius) + 4px);
81+
--color-background: var(--background);
82+
--color-foreground: var(--foreground);
83+
--color-card: var(--card);
84+
--color-card-foreground: var(--card-foreground);
85+
--color-popover: var(--popover);
86+
--color-popover-foreground: var(--popover-foreground);
87+
--color-primary: var(--primary);
88+
--color-primary-foreground: var(--primary-foreground);
89+
--color-secondary: var(--secondary);
90+
--color-secondary-foreground: var(--secondary-foreground);
91+
--color-muted: var(--muted);
92+
--color-muted-foreground: var(--muted-foreground);
93+
--color-accent: var(--accent);
94+
--color-accent-foreground: var(--accent-foreground);
95+
--color-destructive: var(--destructive);
96+
--color-border: var(--border);
97+
--color-input: var(--input);
98+
--color-ring: var(--ring);
99+
--color-chart-1: var(--chart-1);
100+
--color-chart-2: var(--chart-2);
101+
--color-chart-3: var(--chart-3);
102+
--color-chart-4: var(--chart-4);
103+
--color-chart-5: var(--chart-5);
104+
--color-sidebar: var(--sidebar);
105+
--color-sidebar-foreground: var(--sidebar-foreground);
106+
--color-sidebar-primary: var(--sidebar-primary);
107+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
108+
--color-sidebar-accent: var(--sidebar-accent);
109+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
110+
--color-sidebar-border: var(--sidebar-border);
111+
--color-sidebar-ring: var(--sidebar-ring);
112+
}
113+
114+
@layer base {
115+
* {
116+
@apply border-border outline-ring/50;
117+
}
118+
body {
119+
@apply bg-background text-foreground;
120+
}
121+
}

app/frontend/utils.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
}
7+
8+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
9+
export type WithoutChild<T> = T extends { child?: any } ? Omit<T, "child"> : T;
10+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
11+
export type WithoutChildren<T> = T extends { children?: any } ? Omit<T, "children"> : T;
12+
export type WithoutChildrenOrChild<T> = WithoutChildren<WithoutChild<T>>;
13+
export type WithElementRef<T, U extends HTMLElement = HTMLElement> = T & { ref?: U | null };

components.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://shadcn-svelte.com/schema.json",
3+
"tailwind": {
4+
"css": "app/frontend/entrypoints/application.css",
5+
"baseColor": "neutral"
6+
},
7+
"aliases": {
8+
"components": "@/components",
9+
"utils": "@/utils",
10+
"ui": "@/components/ui",
11+
"hooks": "@/hooks",
12+
"lib": "@"
13+
},
14+
"typescript": true,
15+
"registry": "https://shadcn-svelte.com/registry"
16+
}

package-lock.json

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

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"private": true,
33
"type": "module",
44
"devDependencies": {
5+
"@lucide/svelte": "^0.536.0",
6+
"clsx": "^2.1.1",
57
"eslint": "^9.32.0",
68
"eslint-config-prettier": "^10.1.8",
79
"eslint-plugin-import": "^2.32.0",
@@ -11,6 +13,9 @@
1113
"prettier-plugin-svelte": "^3.4.0",
1214
"prettier-plugin-tailwindcss": "^0.6.14",
1315
"svelte": "^5.37.3",
16+
"tailwind-merge": "^3.3.1",
17+
"tailwind-variants": "^2.1.0",
18+
"tw-animate-css": "^1.3.6",
1419
"typescript-eslint": "^8.38.0",
1520
"vite": "^7.0.6",
1621
"vite-plugin-ruby": "^5.1.1"

tsconfig.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
"checkJs": true,
1616
"isolatedModules": true,
1717
"moduleDetection": "force",
18+
19+
/* Aliases */
20+
"baseUrl": ".",
21+
"paths": {
22+
"@/*": ["./app/frontend/*"]
23+
}
1824
},
1925
"include": ["app/frontend/**/*.ts", "app/frontend/**/*.js", "app/frontend/**/*.svelte"],
2026
"references": [{ "path": "./tsconfig.node.json" }]

0 commit comments

Comments
 (0)