|
1 | 1 | <script lang="ts"> |
2 | | - import { Kbd, ToggleGroup, ToggleOption } from 'svelte-ux'; |
3 | | -
|
| 2 | + import { Kbd } from 'svelte-ux'; |
4 | 3 | import Code from '$lib/components/Code.svelte'; |
5 | | -
|
6 | | - let selectedTab = 'svelte-cli'; |
7 | 4 | </script> |
8 | 5 |
|
9 | 6 | <div class="prose max-w-none bg-surface-100 rounded border p-4 mt-4 m-2"> |
10 | 7 | <h1>Getting started</h1> |
11 | 8 |
|
12 | 9 | <h2>Installation</h2> |
13 | | - <ToggleGroup |
14 | | - bind:value={selectedTab} |
15 | | - variant="underline" |
16 | | - classes={{ options: 'justify-start h-10 mb-3' }} |
17 | | - > |
18 | | - <ToggleOption value="svelte-cli">Svelte CLI</ToggleOption> |
19 | | - <ToggleOption value="manual">Manual Install</ToggleOption> |
20 | | - </ToggleGroup> |
21 | | - |
22 | 10 | <div class="grid gap-3"> |
23 | | - {#if selectedTab === 'svelte-cli'} |
24 | | - <div> |
25 | | - Start a new project SvelteKit project with <a |
26 | | - href="https://svelte.dev/docs/cli/overview" |
27 | | - target="_blank">sv</a |
28 | | - > cli |
29 | | - </div> |
30 | | - <Code source={`npm sv create`} language="sh" /> |
31 | | - |
32 | | - <div>Select Tailwind during setup OR run</div> |
33 | | - <Code source={`npx sv add tailwindcss`} language="sh" /> |
34 | | - |
35 | | - <div>Add Svelte UX package</div> |
36 | | - <Code source={`npm install svelte-ux`} language="sh" /> |
37 | | - {:else if selectedTab === 'manual'} |
38 | | - <div> |
39 | | - Follow the Tailwind <a href="https://tailwindcss.com/docs/guides/sveltekit" target="_blank"> |
40 | | - guide |
41 | | - </a> to setup a new SvelteKit project with Tailwind. |
42 | | - </div> |
43 | | - |
44 | | - <div>Add Svelte UX package</div> |
45 | | - <Code source={`npm install svelte-ux`} language="sh" /> |
46 | | - {/if} |
47 | | - |
48 | | - {#if selectedTab === 'svelte-cli' || selectedTab === 'manual'} |
49 | | - <div>Update <code>tailwind.config.cjs</code></div> |
50 | | - <Code |
51 | | - source={`const colors = require('tailwindcss/colors'); |
| 11 | + <ul class="mt-0"> |
| 12 | + <li> |
| 13 | + Svelte UX 1.0.0 requires Tailwind 3. For new projects, Svelte CLI <code>sv</code> installs |
| 14 | + Tailwind 4 which can not be used. Instead you will need to follow the |
| 15 | + <a href="https://v3.tailwindcss.com/docs/guides/sveltekit" target="_blank">official guide</a |
| 16 | + > |
| 17 | + to setup your project. |
| 18 | + </li> |
| 19 | + <li> |
| 20 | + The upcoming Svelte UX 2.0.0 release has been updated to Tailwind 4 and can be previewed |
| 21 | + <a href="https://next.svelte-ux.techniq.dev/" target="_blank">here</a>. |
| 22 | + </li> |
| 23 | + <li>Svelte UX 1.0.0 supports Svelte 3-5, while 2.0.0 will require Svelte 5.</li> |
| 24 | + </ul> |
| 25 | + <div>Add Svelte UX package</div> |
| 26 | + <Code source={`npm install svelte-ux`} language="sh" /> |
| 27 | + |
| 28 | + <div>Update <code>tailwind.config.cjs</code></div> |
| 29 | + <Code |
| 30 | + source={`const colors = require('tailwindcss/colors'); |
52 | 31 | const layerstack = require('@layerstack/tailwind/plugin'); |
53 | 32 |
|
54 | 33 | module.exports = { |
@@ -87,13 +66,11 @@ module.exports = { |
87 | 66 | layerstack, // uses hsl() color space by default. To use oklch(), use: layerstack({ colorSpace: 'oklch' }), |
88 | 67 | ] |
89 | 68 | };`} |
90 | | - language="js" |
91 | | - /> |
92 | | - {/if} |
| 69 | + language="js" |
| 70 | + /> |
93 | 71 | </div> |
94 | 72 |
|
95 | 73 | <p>A few notes regarding the <code>tailwind.config.cjs</code></p> |
96 | | - |
97 | 74 | <ul> |
98 | 75 | <li> |
99 | 76 | <code>{`./node_modules/svelte-ux/**/*.{(svelte, js)}`}</code> adds the library classes via |
|
0 commit comments