|
| 1 | +# Getting started |
| 2 | + |
| 3 | +This kit provides ready-to-use and fully-customizable UI Twig components based on [Shadcn UI](https://ui.shadcn.com/) components's **design**. |
| 4 | + |
| 5 | +Please note that not every Shadcn UI component is available in this kit, but we are working on it! |
| 6 | + |
| 7 | +## Requirements |
| 8 | + |
| 9 | +This kit requires TailwindCSS to work: |
| 10 | +- If you use Symfony AssetMapper, you can install TailwindCSS with the [TailwindBundle](https://symfony.com/bundles/TailwindBundle/current/index.html), |
| 11 | +- If you use Webpack Encore, you can follow the [TailwindCSS installation guide for Symfony](https://tailwindcss.com/docs/installation/framework-guides/symfony) |
| 12 | + |
| 13 | +## Installation |
| 14 | + |
| 15 | +In your `assets/styles/app.css`, after the TailwindCSS imports, add the following code: |
| 16 | + |
| 17 | +```css |
| 18 | +@custom-variant dark (&:is(.dark *)); |
| 19 | + |
| 20 | +:root { |
| 21 | + --radius: 0.625rem; |
| 22 | + --background: oklch(1 0 0); |
| 23 | + --foreground: oklch(0.145 0 0); |
| 24 | + --card: oklch(1 0 0); |
| 25 | + --card-foreground: oklch(0.145 0 0); |
| 26 | + --popover: oklch(1 0 0); |
| 27 | + --popover-foreground: oklch(0.145 0 0); |
| 28 | + --primary: oklch(0.205 0 0); |
| 29 | + --primary-foreground: oklch(0.985 0 0); |
| 30 | + --secondary: oklch(0.97 0 0); |
| 31 | + --secondary-foreground: oklch(0.205 0 0); |
| 32 | + --muted: oklch(0.97 0 0); |
| 33 | + --muted-foreground: oklch(0.556 0 0); |
| 34 | + --accent: oklch(0.97 0 0); |
| 35 | + --accent-foreground: oklch(0.205 0 0); |
| 36 | + --destructive: oklch(0.577 0.245 27.325); |
| 37 | + --border: oklch(0.922 0 0); |
| 38 | + --input: oklch(0.922 0 0); |
| 39 | + --ring: oklch(0.708 0 0); |
| 40 | + --chart-1: oklch(0.646 0.222 41.116); |
| 41 | + --chart-2: oklch(0.6 0.118 184.704); |
| 42 | + --chart-3: oklch(0.398 0.07 227.392); |
| 43 | + --chart-4: oklch(0.828 0.189 84.429); |
| 44 | + --chart-5: oklch(0.769 0.188 70.08); |
| 45 | + --sidebar: oklch(0.985 0 0); |
| 46 | + --sidebar-foreground: oklch(0.145 0 0); |
| 47 | + --sidebar-primary: oklch(0.205 0 0); |
| 48 | + --sidebar-primary-foreground: oklch(0.985 0 0); |
| 49 | + --sidebar-accent: oklch(0.97 0 0); |
| 50 | + --sidebar-accent-foreground: oklch(0.205 0 0); |
| 51 | + --sidebar-border: oklch(0.922 0 0); |
| 52 | + --sidebar-ring: oklch(0.708 0 0); |
| 53 | +} |
| 54 | + |
| 55 | +.dark { |
| 56 | + --background: oklch(0.145 0 0); |
| 57 | + --foreground: oklch(0.985 0 0); |
| 58 | + --card: oklch(0.205 0 0); |
| 59 | + --card-foreground: oklch(0.985 0 0); |
| 60 | + --popover: oklch(0.269 0 0); |
| 61 | + --popover-foreground: oklch(0.985 0 0); |
| 62 | + --primary: oklch(0.922 0 0); |
| 63 | + --primary-foreground: oklch(0.205 0 0); |
| 64 | + --secondary: oklch(0.269 0 0); |
| 65 | + --secondary-foreground: oklch(0.985 0 0); |
| 66 | + --muted: oklch(0.269 0 0); |
| 67 | + --muted-foreground: oklch(0.708 0 0); |
| 68 | + --accent: oklch(0.371 0 0); |
| 69 | + --accent-foreground: oklch(0.985 0 0); |
| 70 | + --destructive: oklch(0.704 0.191 22.216); |
| 71 | + --border: oklch(1 0 0 / 10%); |
| 72 | + --input: oklch(1 0 0 / 15%); |
| 73 | + --ring: oklch(0.556 0 0); |
| 74 | + --chart-1: oklch(0.488 0.243 264.376); |
| 75 | + --chart-2: oklch(0.696 0.17 162.48); |
| 76 | + --chart-3: oklch(0.769 0.188 70.08); |
| 77 | + --chart-4: oklch(0.627 0.265 303.9); |
| 78 | + --chart-5: oklch(0.645 0.246 16.439); |
| 79 | + --sidebar: oklch(0.205 0 0); |
| 80 | + --sidebar-foreground: oklch(0.985 0 0); |
| 81 | + --sidebar-primary: oklch(0.488 0.243 264.376); |
| 82 | + --sidebar-primary-foreground: oklch(0.985 0 0); |
| 83 | + --sidebar-accent: oklch(0.269 0 0); |
| 84 | + --sidebar-accent-foreground: oklch(0.985 0 0); |
| 85 | + --sidebar-border: oklch(1 0 0 / 10%); |
| 86 | + --sidebar-ring: oklch(0.439 0 0); |
| 87 | +} |
| 88 | + |
| 89 | +@layer base { |
| 90 | + * { |
| 91 | + border-color: var(--border); |
| 92 | + outline-color: var(--ring); |
| 93 | + } |
| 94 | + |
| 95 | + body { |
| 96 | + background-color: var(--background); |
| 97 | + color: var(--foreground); |
| 98 | + } |
| 99 | +} |
| 100 | +``` |
| 101 | + |
| 102 | +And voilà! You are now ready to use Shadcn components in your Symfony project. |
0 commit comments