Skip to content

Commit a43b5ae

Browse files
0xmikitechniq
andauthored
Updated the info message and ran formatting check (#609)
* Added banner to redirect to the "next" version and a shell.nix file for convenience when developing on nix systems * tell user to manually install tailwind v3 * Update messaeg and format * Use list to improve layout * Remove point release * Tweak message --------- Co-authored-by: Sean Lynch <[email protected]>
1 parent a39b1dd commit a43b5ae

File tree

3 files changed

+45
-48
lines changed

3 files changed

+45
-48
lines changed

packages/svelte-ux/src/routes/+layout.svelte

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
ThemeSwitch,
1616
Tooltip,
1717
settings,
18+
Icon,
1819
} from 'svelte-ux';
1920
import { DEV } from 'esm-env';
2021
@@ -213,14 +214,25 @@
213214
<!-- Set theme before anything renders (even when SSR is in use) -->
214215
<ThemeInit />
215216

216-
<AppLayout>
217+
<AppLayout headerHeight={96}>
217218
<svelte:fragment slot="nav">
218219
<NavMenu />
219220
<!-- Spacer -->
220221
<div class="h-4"></div>
221222
</svelte:fragment>
222223

223-
<AppBar {title}>
224+
<AppBar {title} class="pt-8">
225+
<div
226+
class="fixed top-0 left-0 w-full h-8 bg-primary-700 border-b border-primary-800/50 shadow flex gap-2 items-center justify-center text-sm font-medium"
227+
>
228+
Svelte UX for Tailwind 4 released! -
229+
<a
230+
href="https://next.svelte-ux.techniq.dev/"
231+
class="font-semibold underline-offset-2 hover:underline"
232+
>
233+
Preview <Icon data={mdiArrowTopRight} class="text-xs mt-[-2px]" />
234+
</a>
235+
</div>
224236
<div slot="actions" class="flex gap-3">
225237
<Button
226238
href="https://www.layerchart.com"

packages/svelte-ux/src/routes/+page.svelte

Lines changed: 23 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,33 @@
11
<script lang="ts">
2-
import { Kbd, ToggleGroup, ToggleOption } from 'svelte-ux';
3-
2+
import { Kbd } from 'svelte-ux';
43
import Code from '$lib/components/Code.svelte';
5-
6-
let selectedTab = 'svelte-cli';
74
</script>
85

96
<div class="prose max-w-none bg-surface-100 rounded border p-4 mt-4 m-2">
107
<h1>Getting started</h1>
118

129
<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-
2210
<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');
5231
const layerstack = require('@layerstack/tailwind/plugin');
5332
5433
module.exports = {
@@ -87,13 +66,11 @@ module.exports = {
8766
layerstack, // uses hsl() color space by default. To use oklch(), use: layerstack({ colorSpace: 'oklch' }),
8867
]
8968
};`}
90-
language="js"
91-
/>
92-
{/if}
69+
language="js"
70+
/>
9371
</div>
9472

9573
<p>A few notes regarding the <code>tailwind.config.cjs</code></p>
96-
9774
<ul>
9875
<li>
9976
<code>{`./node_modules/svelte-ux/**/*.{(svelte, js)}`}</code> adds the library classes via

shell.nix

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{ pkgs ? import <nixpkgs> {} }:
2+
3+
pkgs.mkShell {
4+
buildInputs = with pkgs; [
5+
nodejs
6+
pnpm
7+
];
8+
}

0 commit comments

Comments
 (0)