|
1 | 1 | # GOOEY |
2 | | -A collection of Vue components based on Tailwind, Shadcn-vue, and others. |
| 2 | + |
| 3 | +A collection of Vue components based on Tailwind CSS, Shadcn-vue, and others. |
| 4 | + |
| 5 | +## Installation |
| 6 | + |
| 7 | +```bash |
| 8 | +npm install @codinglabsau/gooey |
| 9 | +``` |
| 10 | + |
| 11 | +This library supports both **Tailwind CSS v3** and **Tailwind CSS v4**. Choose the setup instructions for your version. |
| 12 | + |
| 13 | +### Tailwind v4 Setup |
| 14 | + |
| 15 | +1. Install dependencies: |
| 16 | + |
| 17 | +```bash |
| 18 | +npm install -D tailwindcss @tailwindcss/vite tw-animate-css |
| 19 | +``` |
| 20 | + |
| 21 | +2. Add the Tailwind plugin to your `vite.config.js`: |
| 22 | + |
| 23 | +```js |
| 24 | +import tailwindcss from '@tailwindcss/vite' |
| 25 | + |
| 26 | +export default defineConfig({ |
| 27 | + plugins: [tailwindcss()], |
| 28 | +}) |
| 29 | +``` |
| 30 | + |
| 31 | +3. Import the preset in your main CSS file: |
| 32 | + |
| 33 | +```css |
| 34 | +@import "tailwindcss"; |
| 35 | +@import "tw-animate-css"; |
| 36 | +@import "@codinglabsau/gooey/presets/slate.css"; |
| 37 | + |
| 38 | +@custom-variant dark (&:is(.dark *)); |
| 39 | + |
| 40 | +@source "./node_modules/@codinglabsau/gooey"; |
| 41 | + |
| 42 | +@theme { |
| 43 | + --color-border: hsl(var(--border)); |
| 44 | + --color-input: hsl(var(--input)); |
| 45 | + --color-ring: hsl(var(--ring)); |
| 46 | + --color-background: hsl(var(--background)); |
| 47 | + --color-foreground: hsl(var(--foreground)); |
| 48 | + |
| 49 | + --color-primary: hsl(var(--primary)); |
| 50 | + --color-primary-foreground: hsl(var(--primary-foreground)); |
| 51 | + |
| 52 | + --color-secondary: hsl(var(--secondary)); |
| 53 | + --color-secondary-foreground: hsl(var(--secondary-foreground)); |
| 54 | + |
| 55 | + --color-destructive: hsl(var(--destructive)); |
| 56 | + --color-destructive-foreground: hsl(var(--destructive-foreground)); |
| 57 | + |
| 58 | + --color-success: hsl(var(--success)); |
| 59 | + --color-success-foreground: hsl(var(--success-foreground)); |
| 60 | + |
| 61 | + --color-warning: hsl(var(--warning)); |
| 62 | + --color-warning-foreground: hsl(var(--warning-foreground)); |
| 63 | + |
| 64 | + --color-muted: hsl(var(--muted)); |
| 65 | + --color-muted-foreground: hsl(var(--muted-foreground)); |
| 66 | + |
| 67 | + --color-accent: hsl(var(--accent)); |
| 68 | + --color-accent-foreground: hsl(var(--accent-foreground)); |
| 69 | + |
| 70 | + --color-popover: hsl(var(--popover)); |
| 71 | + --color-popover-foreground: hsl(var(--popover-foreground)); |
| 72 | + |
| 73 | + --color-card: hsl(var(--card)); |
| 74 | + --color-card-foreground: hsl(var(--card-foreground)); |
| 75 | + |
| 76 | + --radius-xl: calc(var(--radius) + 4px); |
| 77 | + --radius-lg: var(--radius); |
| 78 | + --radius-md: calc(var(--radius) - 2px); |
| 79 | + --radius-sm: calc(var(--radius) - 4px); |
| 80 | + |
| 81 | + --animate-accordion-down: accordion-down 0.2s ease-out; |
| 82 | + --animate-accordion-up: accordion-up 0.2s ease-out; |
| 83 | + --animate-collapsible-down: collapsible-down 0.2s ease-in-out; |
| 84 | + --animate-collapsible-up: collapsible-up 0.2s ease-in-out; |
| 85 | +} |
| 86 | + |
| 87 | +@keyframes accordion-down { |
| 88 | + from { height: 0; } |
| 89 | + to { height: var(--radix-accordion-content-height); } |
| 90 | +} |
| 91 | + |
| 92 | +@keyframes accordion-up { |
| 93 | + from { height: var(--radix-accordion-content-height); } |
| 94 | + to { height: 0; } |
| 95 | +} |
| 96 | + |
| 97 | +@keyframes collapsible-down { |
| 98 | + from { height: 0; } |
| 99 | + to { height: var(--radix-collapsible-content-height); } |
| 100 | +} |
| 101 | + |
| 102 | +@keyframes collapsible-up { |
| 103 | + from { height: var(--radix-collapsible-content-height); } |
| 104 | + to { height: 0; } |
| 105 | +} |
| 106 | +``` |
| 107 | + |
| 108 | +### Tailwind v3 Setup |
| 109 | + |
| 110 | +1. Install dependencies: |
| 111 | + |
| 112 | +```bash |
| 113 | +npm install -D tailwindcss postcss autoprefixer tailwindcss-animate |
| 114 | +``` |
| 115 | + |
| 116 | +2. Add the preset to your `tailwind.config.js`: |
| 117 | + |
| 118 | +```js |
| 119 | +import { preset } from '@codinglabsau/gooey/presets/v3' |
| 120 | + |
| 121 | +export default { |
| 122 | + darkMode: ['class'], |
| 123 | + presets: [preset], |
| 124 | + content: [ |
| 125 | + './node_modules/@codinglabsau/gooey/**/*.{js,vue}', |
| 126 | + // ... your content paths |
| 127 | + ], |
| 128 | +} |
| 129 | +``` |
| 130 | + |
| 131 | +3. Import the theme CSS in your main stylesheet: |
| 132 | + |
| 133 | +```css |
| 134 | +@tailwind base; |
| 135 | +@tailwind components; |
| 136 | +@tailwind utilities; |
| 137 | + |
| 138 | +@import '@codinglabsau/gooey/dist/presets/slate.css'; |
| 139 | +``` |
3 | 140 |
|
4 | 141 | ## Documentation |
| 142 | + |
5 | 143 | The documentation is available in the `./app` directory. This serves as documentation, test target, and sandbox for prototyping. |
6 | 144 |
|
7 | 145 | ```bash |
8 | | -vite |
| 146 | +npm run dev |
9 | 147 | ``` |
10 | 148 |
|
11 | 149 | ## Testing |
12 | | -Tests are implemented with Cypress, and can be run on CLI using `npm run tests`. We are implementing end-to-end tests as most components are tested upstream. |
| 150 | + |
| 151 | +Tests are implemented with Cypress, and can be run on CLI using `npm run test`. We are implementing end-to-end tests as most components are tested upstream. |
13 | 152 |
|
14 | 153 | For shadcn components, we do simple smoke tests to ensure they are not generating errors with basic usage. |
15 | 154 |
|
16 | 155 | For custom components, we are testing the functionality in depth. |
17 | 156 |
|
18 | 157 | ## Security |
| 158 | + |
19 | 159 | If you discover any security related issues, create an issue on GitHub. |
20 | 160 |
|
21 | 161 | ## Credits |
| 162 | + |
22 | 163 | - [Steve Thomas](https://github.com/stevethomas) |
23 | 164 | - [All Contributors](../../contributors) |
24 | 165 |
|
25 | 166 | ## License |
| 167 | + |
26 | 168 | MIT |
27 | 169 |
|
28 | 170 | ## About Coding Labs |
| 171 | + |
29 | 172 | Coding Labs is a web app development agency based on the Gold Coast, Australia. See our open source projects [on our website](https://codinglabs.com.au/open-source). |
0 commit comments