Skip to content

Commit 1bd98a7

Browse files
committed
docs: General improvements and add tailwind plugin page
1 parent 9430d76 commit 1bd98a7

5 files changed

Lines changed: 88 additions & 7 deletions

File tree

sites/docs/src/routes/+page.svelte

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,30 @@
33
</script>
44

55
<div class="prose max-w-none bg-surface-100 rounded border p-4 mt-4 m-2">
6-
<h1>Getting started</h1>
6+
<h1>Introduction</h1>
77

8-
<h2>TODO</h2>
8+
<p>
9+
LayerStack is a collection of packages ranging from general utilities (similar to lodash),
10+
<a href="https://tailwindcss.com/" target="_blank">Tailwind CSS</a>
11+
theming and utils, and <a href="https://svelte.dev/" target="_blank">Svelte</a> actions and stores.
12+
</p>
13+
14+
<p>Each package can be installed separately, but also complement one another.</p>
15+
16+
<h2>Packages:</h2>
17+
<ul>
18+
<li><a href="/docs/svelte-actions">@layerstack/svelte-actions</a></li>
19+
<li><a href="/docs/svelte-stores">@layerstack/svelte-stores</a></li>
20+
<li><a href="/docs/svelte-table">@layerstack/svelte-table</a></li>
21+
<li><a href="/docs/tailwind">@layerstack/tailwind</a></li>
22+
<li><a href="/docs/utils">@layerstack/utils</a></li>
23+
</ul>
24+
25+
<p>
26+
See also the Svelte companion component libraries, <a
27+
href="https://layerchart.com"
28+
target="_blank">LayerChart</a
29+
>
30+
and <a href="https://svelte-ux.techniq.dev" target="_blank">Svelte UX</a>
31+
</p>
932
</div>

sites/docs/src/routes/_NavMenu.svelte

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { NavItem } from 'svelte-ux';
33
44
import { page } from '$app/stores';
5-
import { mdiCog, mdiFormatListBulleted, mdiHome, mdiPalette } from '@mdi/js';
5+
import { mdiHome } from '@mdi/js';
66
77
const actions = [
88
'dataBackground',
@@ -40,12 +40,11 @@
4040
];
4141
4242
const table = ['actions', 'stores'];
43-
const tailwind = ['utils'];
43+
const tailwind = ['plugin', 'utils'];
4444
const utils = ['duration', 'format', 'json', 'Logger', 'string'];
4545
</script>
4646

47-
<NavItem text="Getting Started" icon={mdiHome} currentUrl={$page.url} path="/" />
48-
<!-- <NavItem text="Changelog" icon={mdiFormatListBulleted} currentUrl={$page.url} path="/changelog" /> -->
47+
<NavItem text="Introduction" icon={mdiHome} currentUrl={$page.url} path="/" />
4948

5049
<h1>svelte-actions</h1>
5150
{#each actions as item}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { redirect } from '@sveltejs/kit';
22

33
export async function load({ url }) {
4-
redirect(302, '/docs/tailwind/utils');
4+
redirect(302, '/docs/tailwind/plugin');
55
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<script lang="ts">
2+
import Preview from '$docs/Preview.svelte';
3+
</script>
4+
5+
<h1>Usage</h1>
6+
7+
```js
8+
const colors = require('tailwindcss/colors');
9+
const layerstack = require('@layerstack/tailwind/plugin');
10+
11+
/** @type {import('tailwindcss').Config}*/
12+
const config = {
13+
content: ['./src/**/*.{html,svelte}', './node_modules/svelte-ux/**/*.{svelte,js}'],
14+
ux: {
15+
// see also: https://svelte-ux.techniq.dev/customization
16+
themes: {
17+
// light mode
18+
light: {
19+
primary: colors['emerald']['600'],
20+
'primary-content': 'white',
21+
secondary: colors['blue']['500'],
22+
'surface-100': 'white',
23+
'surface-200': colors['gray']['100'],
24+
'surface-300': colors['gray']['300'],
25+
'surface-content': colors['gray']['900'],
26+
},
27+
// dark mode
28+
dark: {
29+
primary: colors['emerald']['600'],
30+
'primary-content': 'white',
31+
secondary: colors['blue']['500'],
32+
'surface-100': colors['zinc']['800'],
33+
'surface-200': colors['zinc']['900'],
34+
'surface-300': colors['zinc']['950'],
35+
'surface-content': colors['zinc']['100'],
36+
},
37+
},
38+
},
39+
plugins: [layerstack],
40+
};
41+
42+
module.exports = config;
43+
```
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import source from '$tailwind/plugin.cjs?raw';
2+
import pageSource from './+page.md?raw';
3+
4+
export async function load() {
5+
return {
6+
meta: {
7+
source,
8+
pageSource,
9+
description: 'Tailwind CSS plugiun to providing theming and additional utility classes',
10+
related: [
11+
'https://svelte-ux.techniq.dev/customization',
12+
'https://svelte-ux.techniq.dev/theme',
13+
],
14+
},
15+
};
16+
}

0 commit comments

Comments
 (0)