|
33 | 33 | <Code source={`npx sv add tailwindcss`} language="sh" />
|
34 | 34 |
|
35 | 35 | <div>Add Svelte UX package</div>
|
36 |
| - <Code source={`npm install svelte-ux`} language="sh" /> |
| 36 | + <Code source={`npm install svelte-ux@next`} language="sh" /> |
37 | 37 | {:else if selectedTab === 'manual'}
|
38 | 38 | <div>
|
39 | 39 | Follow the Tailwind <a href="https://tailwindcss.com/docs/guides/sveltekit" target="_blank">
|
|
42 | 42 | </div>
|
43 | 43 |
|
44 | 44 | <div>Add Svelte UX package</div>
|
45 |
| - <Code source={`npm install svelte-ux`} language="sh" /> |
| 45 | + <Code source={`npm install svelte-ux@next`} language="sh" /> |
46 | 46 | {/if}
|
47 | 47 |
|
48 | 48 | {#if selectedTab === 'svelte-cli' || selectedTab === 'manual'}
|
49 |
| - <div>Update <code>tailwind.config.cjs</code></div> |
| 49 | + <div>Update <code>app.css</code></div> |
50 | 50 | <Code
|
51 |
| - source={`const colors = require('tailwindcss/colors'); |
52 |
| -const layerstack = require('@layerstack/tailwind/plugin'); |
53 |
| -
|
54 |
| -module.exports = { |
55 |
| - content: [ |
56 |
| - './src/**/*.{html,svelte}', |
57 |
| - './node_modules/svelte-ux/**/*.{svelte,js}' |
58 |
| - ], |
59 |
| -
|
60 |
| - // See customization docs: https://svelte-ux.techniq.dev/customization |
61 |
| - ux: { |
62 |
| - themes: { |
63 |
| - light: { |
64 |
| - primary: colors['orange']['500'], |
65 |
| - 'primary-content': 'white', |
66 |
| - secondary: colors['blue']['500'], |
67 |
| - 'surface-100': 'white', |
68 |
| - 'surface-200': colors['gray']['100'], |
69 |
| - 'surface-300': colors['gray']['300'], |
70 |
| - 'surface-content': colors['gray']['900'], |
71 |
| - 'color-scheme': 'light' |
72 |
| - }, |
73 |
| - dark: { |
74 |
| - primary: colors['orange']['500'], |
75 |
| - 'primary-content': 'white', |
76 |
| - secondary: colors['blue']['500'], |
77 |
| - 'surface-100': colors['zinc']['800'], |
78 |
| - 'surface-200': colors['zinc']['900'], |
79 |
| - 'surface-300': colors['zinc']['950'], |
80 |
| - 'surface-content': colors['zinc']['100'], |
81 |
| - 'color-scheme': 'dark' |
82 |
| - }, |
83 |
| - }, |
84 |
| - }, |
85 |
| -
|
86 |
| - plugins: [ |
87 |
| - layerstack, // uses hsl() color space by default. To use oklch(), use: layerstack({ colorSpace: 'oklch' }), |
88 |
| - ] |
89 |
| -};`} |
90 |
| - language="js" |
| 51 | + source={`@import 'tailwindcss'; |
| 52 | +@import '@layerstack/tailwind/core.css'; |
| 53 | +@import '@layerstack/tailwind/utils.css'; |
| 54 | +@import '@layerstack/tailwind/themes/basic.css'; // Note: Theme choice explained below |
| 55 | +
|
| 56 | +@source '../../node_modules/svelte-ux/dist'; |
| 57 | +@source '../../node_modules/@layerchart/dist'; |
| 58 | +
|
| 59 | +// You can customize your theme as you see fit using CSS variables. Dark mode is targeted using with .dark class on :root/<html> |
| 60 | +:root { |
| 61 | + --color-primary: var(--color-purple-700); |
| 62 | + --color-secondary: var(--color-orange-500); |
| 63 | +
|
| 64 | + &.dark { |
| 65 | + --color-primary: var(--color-purple-400); |
| 66 | + --color-surface-100: var(--color-zinc-900); |
| 67 | + --color-surface-200: var(--color-zinc-950); |
| 68 | + --color-surface-300: var(--color-black); |
| 69 | + } |
| 70 | +} |
| 71 | +`} |
| 72 | + language="css" |
91 | 73 | />
|
92 | 74 | {/if}
|
93 | 75 | </div>
|
94 | 76 |
|
95 |
| - <p>A few notes regarding the <code>tailwind.config.cjs</code></p> |
96 |
| - |
97 |
| - <ul> |
98 |
| - <li> |
99 |
| - <code>{`./node_modules/svelte-ux/**/*.{(svelte, js)}`}</code> adds the library classes via |
100 |
| - <a href="https://tailwindcss.com/docs/content-configuration">JIT</a> |
101 |
| - </li> |
| 77 | + <strong class="block mt-3 mb-1 text-surface-content">Theme setup:</strong> |
| 78 | + <ul class="list-disc pl-6 space-y-1 my-1 text-sm text-surface-content"> |
102 | 79 | <li>
|
103 |
| - <code>ux.themes</code> is used to configure the theme colors. See |
104 |
| - <a href="/customization">customization</a> for more details. |
| 80 | + The line <code>@import '@layerstack/tailwind/themes/basic.css';</code> in the CSS example |
| 81 | + above provides basic light and dark theme support. If you require multiple light/dark |
| 82 | + themes, or want to use pre-built themes like Skeleton or Daisy UI (which is what the |
| 83 | + Svelte UX <a |
| 84 | + href="https://github.com/techniq/svelte-ux/blob/next/packages/svelte-ux/src/routes/app.css" |
| 85 | + target="_blank">docs</a |
| 86 | + > use), you should replace this line with |
| 87 | + <code>@import '@layerstack/tailwind/themes/all.css';</code>. |
105 | 88 | </li>
|
106 | 89 | <li>
|
107 |
| - Tailwind plugin injects the theme color variables, sets border, outline, ring, and typograpy |
108 |
| - defauls based on the theme, and adds additional utility classes including: |
109 |
| - <ul> |
110 |
| - <li> |
111 |
| - <code>elevation-#</code> for |
112 |
| - <a |
113 |
| - class="text-primary font-medium" |
114 |
| - href="https://www.joshwcomeau.com/css/designing-shadows/" |
115 |
| - rel="nofollow">realistic shadows</a |
116 |
| - > |
117 |
| - using multiple shadow layers, unlike the current Tailwind |
118 |
| - <a |
119 |
| - class="text-primary font-medium" |
120 |
| - href="https://tailwindcss.com/docs/box-shadow" |
121 |
| - rel="nofollow">shadows</a |
122 |
| - > |
123 |
| - which have at most 2 layers. |
124 |
| - </li> |
125 |
| - <li> |
126 |
| - <code>grid-stack</code> to easily stack grid children |
127 |
| - </li> |
128 |
| - <li> |
129 |
| - <code>scrollbar-none</code> to hide the scrollbar |
130 |
| - </li> |
131 |
| - </ul> |
| 90 | + @layerstack/tailwind (the theme system used by Svelte UX) was migrated to be css-only. You |
| 91 | + can see the source on the next branch <a |
| 92 | + href="https://github.com/techniq/layerstack/tree/next/packages/tailwind/src/lib/css" |
| 93 | + target="_blank">here</a |
| 94 | + > |
132 | 95 | </li>
|
133 | 96 | </ul>
|
134 | 97 |
|
|
0 commit comments