@axerity/cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/axerity.default.json +135 -0
- package/axerity.schema.json +268 -0
- package/bin/axerity.js +305 -0
- package/mdsvex.config.js +261 -0
- package/package.json +103 -0
- package/scripts/prepare-engine.mjs +20 -0
- package/src/app.d.ts +17 -0
- package/src/app.html +39 -0
- package/src/content/demo/api/meta.json +5 -0
- package/src/content/demo/api/pet/add-pet.md +105 -0
- package/src/content/demo/api/pet/delete-pet.md +70 -0
- package/src/content/demo/api/pet/find-by-status.md +72 -0
- package/src/content/demo/api/pet/find-by-tags.md +64 -0
- package/src/content/demo/api/pet/get-pet.md +99 -0
- package/src/content/demo/api/pet/meta.json +15 -0
- package/src/content/demo/api/pet/pet-object.md +112 -0
- package/src/content/demo/api/pet/update-pet-with-form.md +69 -0
- package/src/content/demo/api/pet/update-pet.md +79 -0
- package/src/content/demo/api/pet/upload-image.md +79 -0
- package/src/content/demo/api/store/delete-order.md +62 -0
- package/src/content/demo/api/store/get-order.md +70 -0
- package/src/content/demo/api/store/inventory.md +54 -0
- package/src/content/demo/api/store/meta.json +5 -0
- package/src/content/demo/api/store/order-object.md +77 -0
- package/src/content/demo/api/store/place-order.md +83 -0
- package/src/content/demo/api/user/create-user.md +69 -0
- package/src/content/demo/api/user/create-with-list.md +57 -0
- package/src/content/demo/api/user/delete-user.md +61 -0
- package/src/content/demo/api/user/get-user.md +69 -0
- package/src/content/demo/api/user/login.md +80 -0
- package/src/content/demo/api/user/logout.md +45 -0
- package/src/content/demo/api/user/meta.json +14 -0
- package/src/content/demo/api/user/update-user.md +69 -0
- package/src/content/demo/api/user/user-object.md +85 -0
- package/src/content/demo/changelog.md +44 -0
- package/src/content/demo/components/accordion.md +70 -0
- package/src/content/demo/components/api.md +185 -0
- package/src/content/demo/components/badge.md +34 -0
- package/src/content/demo/components/callout.md +83 -0
- package/src/content/demo/components/cards.md +88 -0
- package/src/content/demo/components/code-group.md +55 -0
- package/src/content/demo/components/columns.md +42 -0
- package/src/content/demo/components/frame.md +51 -0
- package/src/content/demo/components/icon.md +54 -0
- package/src/content/demo/components/kbd.md +28 -0
- package/src/content/demo/components/meta.json +26 -0
- package/src/content/demo/components/roadmap.md +86 -0
- package/src/content/demo/components/steps.md +72 -0
- package/src/content/demo/components/tabs.md +146 -0
- package/src/content/demo/components/tooltip.md +44 -0
- package/src/content/demo/components/tree.md +83 -0
- package/src/content/demo/components/type-table.md +77 -0
- package/src/content/demo/components/update.md +48 -0
- package/src/content/demo/components/video.md +56 -0
- package/src/content/demo/components/webhooks.md +109 -0
- package/src/content/demo/components/websockets.md +101 -0
- package/src/content/demo/configuration/ai.md +40 -0
- package/src/content/demo/configuration/cli.md +46 -0
- package/src/content/demo/configuration/deployment.md +105 -0
- package/src/content/demo/configuration/index.md +92 -0
- package/src/content/demo/configuration/layouts.md +51 -0
- package/src/content/demo/configuration/meta.json +5 -0
- package/src/content/demo/configuration/navigation.md +167 -0
- package/src/content/demo/configuration/openapi.md +103 -0
- package/src/content/demo/configuration/search.md +36 -0
- package/src/content/demo/index.md +59 -0
- package/src/content/demo/installation.md +49 -0
- package/src/content/demo/meta.json +15 -0
- package/src/content/demo/quick-start.md +47 -0
- package/src/content/demo/theming/advanced.md +116 -0
- package/src/content/demo/theming/code.md +66 -0
- package/src/content/demo/theming/colors.md +103 -0
- package/src/content/demo/theming/index.md +88 -0
- package/src/content/demo/theming/layout.md +71 -0
- package/src/content/demo/theming/meta.json +5 -0
- package/src/content/demo/theming/themes.md +99 -0
- package/src/content/demo/theming/typography.md +83 -0
- package/src/content/demo/writing/code-blocks.md +154 -0
- package/src/content/demo/writing/diagrams.md +44 -0
- package/src/content/demo/writing/frontmatter.md +33 -0
- package/src/content/demo/writing/markdown.md +62 -0
- package/src/content/demo/writing/meta.json +5 -0
- package/src/hooks.server.ts +49 -0
- package/src/lib/assets/favicon.svg +1 -0
- package/src/lib/base.ts +12 -0
- package/src/lib/components/DynamicIcon.svelte +26 -0
- package/src/lib/components/docs/Analytics.svelte +38 -0
- package/src/lib/components/docs/Banner.svelte +44 -0
- package/src/lib/components/docs/Breadcrumbs.svelte +38 -0
- package/src/lib/components/docs/CopyPageMenu.svelte +119 -0
- package/src/lib/components/docs/DocsLayout.svelte +192 -0
- package/src/lib/components/docs/Footer.svelte +60 -0
- package/src/lib/components/docs/Mermaid.svelte +39 -0
- package/src/lib/components/docs/Navbar.svelte +144 -0
- package/src/lib/components/docs/PageMeta.svelte +35 -0
- package/src/lib/components/docs/PageNav.svelte +44 -0
- package/src/lib/components/docs/SearchDialog.svelte +182 -0
- package/src/lib/components/docs/Sidebar.svelte +85 -0
- package/src/lib/components/docs/SidebarDropdown.svelte +56 -0
- package/src/lib/components/docs/SidebarFooterLinks.svelte +19 -0
- package/src/lib/components/docs/SidebarGroup.svelte +54 -0
- package/src/lib/components/docs/SidebarLink.svelte +67 -0
- package/src/lib/components/docs/TableOfContents.svelte +77 -0
- package/src/lib/components/docs/ThemeToggle.svelte +19 -0
- package/src/lib/components/docs/VersionSwitcher.svelte +80 -0
- package/src/lib/components/kit/Accordion.svelte +60 -0
- package/src/lib/components/kit/AccordionGroup.svelte +13 -0
- package/src/lib/components/kit/Badge.svelte +32 -0
- package/src/lib/components/kit/Callout.svelte +51 -0
- package/src/lib/components/kit/Card.svelte +72 -0
- package/src/lib/components/kit/CardGroup.svelte +21 -0
- package/src/lib/components/kit/CodeGroup.svelte +65 -0
- package/src/lib/components/kit/Columns.svelte +26 -0
- package/src/lib/components/kit/Event.svelte +23 -0
- package/src/lib/components/kit/EventList.svelte +9 -0
- package/src/lib/components/kit/File.svelte +15 -0
- package/src/lib/components/kit/Folder.svelte +46 -0
- package/src/lib/components/kit/Frame.svelte +81 -0
- package/src/lib/components/kit/Icon.svelte +17 -0
- package/src/lib/components/kit/Kbd.svelte +11 -0
- package/src/lib/components/kit/Roadmap.svelte +15 -0
- package/src/lib/components/kit/RoadmapItem.svelte +109 -0
- package/src/lib/components/kit/Step.svelte +63 -0
- package/src/lib/components/kit/Steps.svelte +16 -0
- package/src/lib/components/kit/Tab.svelte +27 -0
- package/src/lib/components/kit/Tabs.svelte +75 -0
- package/src/lib/components/kit/Tooltip.svelte +33 -0
- package/src/lib/components/kit/Tree.svelte +11 -0
- package/src/lib/components/kit/TypeTable.svelte +187 -0
- package/src/lib/components/kit/Update.svelte +32 -0
- package/src/lib/components/kit/Video.svelte +64 -0
- package/src/lib/components/kit/accordion-context.ts +1 -0
- package/src/lib/components/kit/api/Api.svelte +80 -0
- package/src/lib/components/kit/api/ApiExamplePanel.svelte +100 -0
- package/src/lib/components/kit/api/ApiField.svelte +124 -0
- package/src/lib/components/kit/api/Channel.svelte +121 -0
- package/src/lib/components/kit/api/Endpoint.svelte +116 -0
- package/src/lib/components/kit/api/Enum.svelte +44 -0
- package/src/lib/components/kit/api/EnumValues.svelte +35 -0
- package/src/lib/components/kit/api/Expandable.svelte +70 -0
- package/src/lib/components/kit/api/Message.svelte +67 -0
- package/src/lib/components/kit/api/ObjectExample.svelte +11 -0
- package/src/lib/components/kit/api/RequestExample.svelte +11 -0
- package/src/lib/components/kit/api/ResponseExample.svelte +11 -0
- package/src/lib/components/kit/api/Webhook.svelte +115 -0
- package/src/lib/components/kit/api/api-context.ts +15 -0
- package/src/lib/components/kit/tabs-context.ts +8 -0
- package/src/lib/components/kit/tabs-store.svelte.ts +28 -0
- package/src/lib/config/site.ts +34 -0
- package/src/lib/content/index.ts +50 -0
- package/src/lib/content/raw.ts +21 -0
- package/src/lib/content/tree.ts +169 -0
- package/src/lib/index.ts +79 -0
- package/src/lib/nav-match.ts +23 -0
- package/src/lib/openapi/generate.ts +629 -0
- package/src/lib/server/og.ts +140 -0
- package/src/lib/state/search.svelte.ts +9 -0
- package/src/lib/state/theme.svelte.ts +58 -0
- package/src/lib/types.ts +216 -0
- package/src/params/docpage.ts +3 -0
- package/src/params/mdfile.ts +3 -0
- package/src/routes/+error.svelte +46 -0
- package/src/routes/+layout.svelte +25 -0
- package/src/routes/[...path=mdfile]/+server.ts +21 -0
- package/src/routes/[...slug=docpage]/+page.svelte +63 -0
- package/src/routes/[...slug=docpage]/+page.ts +44 -0
- package/src/routes/layout.css +897 -0
- package/src/routes/llms-full.txt/+server.ts +22 -0
- package/src/routes/llms.txt/+server.ts +20 -0
- package/src/routes/og/[...slug]/+server.ts +77 -0
- package/src/routes/rss.xml/+server.ts +65 -0
- package/src/routes/search.json/+server.ts +54 -0
- package/src/routes/sitemap.xml/+server.ts +21 -0
- package/static/favicon-dark.svg +6 -0
- package/static/favicon-light.svg +6 -0
- package/static/favicon.svg +14 -0
- package/static/fonts/geist-400.ttf +0 -0
- package/static/fonts/geist-600.ttf +0 -0
- package/static/fonts/geist-700.ttf +0 -0
- package/static/og-image.png +0 -0
- package/static/robots.txt +4 -0
- package/svelte.config.js +35 -0
- package/tsconfig.json +20 -0
- package/vite.config.ts +46 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Installation
|
|
3
|
+
description: Get Axerity running locally in a minute.
|
|
4
|
+
icon: download
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Installation
|
|
8
|
+
|
|
9
|
+
Axerity is a CLI. You do not clone or fork anything. Install it, scaffold a site,
|
|
10
|
+
and start writing Markdown.
|
|
11
|
+
|
|
12
|
+
## Requirements
|
|
13
|
+
|
|
14
|
+
- Node.js 20 or newer
|
|
15
|
+
|
|
16
|
+
## Create a site
|
|
17
|
+
|
|
18
|
+
Scaffold a new site with `init`, then start the dev server:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx axerity init my-docs
|
|
22
|
+
cd my-docs
|
|
23
|
+
npx axerity dev
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Your site is running at `http://localhost:5173`. Or install it globally and drop
|
|
27
|
+
the `npx`:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install -g axerity
|
|
31
|
+
axerity init my-docs
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Project layout
|
|
35
|
+
|
|
36
|
+
A site is just your content and one config file. Everything else lives in the
|
|
37
|
+
package:
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
my-docs/
|
|
41
|
+
axerity.json site configuration
|
|
42
|
+
docs/ your markdown + meta.json
|
|
43
|
+
public/ optional images and assets
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Write Markdown in `docs/`, order pages with `meta.json`, and configure the site
|
|
47
|
+
in [`axerity.json`](/configuration). The CLI builds a hidden `.axerity`
|
|
48
|
+
workspace to run the engine against your content, so add `.axerity` to your
|
|
49
|
+
`.gitignore` (the scaffold does this for you).
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Quick Start
|
|
3
|
+
description: Write your first page in two minutes.
|
|
4
|
+
icon: rocket
|
|
5
|
+
badge: New
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Quick Start
|
|
9
|
+
|
|
10
|
+
Adding a page is just creating a Markdown file. Let's add one.
|
|
11
|
+
|
|
12
|
+
## Create a page
|
|
13
|
+
|
|
14
|
+
Make a new file at `src/content/docs/hello.md`:
|
|
15
|
+
|
|
16
|
+
```md
|
|
17
|
+
---
|
|
18
|
+
title: Hello
|
|
19
|
+
icon: book-open
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# Hello
|
|
23
|
+
|
|
24
|
+
My first Axerity page.
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
It's immediately available at `/hello` and shows up in the sidebar.
|
|
28
|
+
|
|
29
|
+
## Order it with meta.json
|
|
30
|
+
|
|
31
|
+
Each folder has a `meta.json` that controls titles, icons, and ordering:
|
|
32
|
+
|
|
33
|
+
```json
|
|
34
|
+
{
|
|
35
|
+
"title": "Getting Started",
|
|
36
|
+
"icon": "rocket",
|
|
37
|
+
"pages": ["index", "installation", "quick-start", "hello"]
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Pages listed in `pages` appear in that order; anything you leave out is appended
|
|
42
|
+
alphabetically.
|
|
43
|
+
|
|
44
|
+
## Organize with folders
|
|
45
|
+
|
|
46
|
+
Create a subfolder with its own `meta.json` and it becomes a new sidebar
|
|
47
|
+
section. Subfolders are ordered by naming them in the parent's `pages` list.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Advanced
|
|
3
|
+
description: Radius, custom tokens, prose, and whole new themes.
|
|
4
|
+
icon: sliders
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import { Callout } from '$lib';
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
# Advanced theming
|
|
12
|
+
|
|
13
|
+
Everything you need to take theming as far as you want.
|
|
14
|
+
|
|
15
|
+
## Roundness
|
|
16
|
+
|
|
17
|
+
Axerity overrides Tailwind's radius scale in one place, so **every** `rounded-*`
|
|
18
|
+
utility across the UI changes at once:
|
|
19
|
+
|
|
20
|
+
```css title="src/routes/layout.css"
|
|
21
|
+
@theme inline {
|
|
22
|
+
--radius-sm: 0.125rem;
|
|
23
|
+
--radius-md: 0.25rem;
|
|
24
|
+
--radius-lg: 0.375rem;
|
|
25
|
+
--radius-xl: 0.5rem;
|
|
26
|
+
--radius-2xl: 0.625rem;
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Want pill-soft corners? Scale these up. Want sharp, terminal-like edges? Set them
|
|
31
|
+
all to `0`.
|
|
32
|
+
|
|
33
|
+
## Make light the default
|
|
34
|
+
|
|
35
|
+
Axerity defaults to dark. To default to light, change two spots:
|
|
36
|
+
|
|
37
|
+
```ts title="src/lib/state/theme.svelte.ts"
|
|
38
|
+
class ThemeState {
|
|
39
|
+
preference = $state<ThemePreference>('light'); // was 'dark'
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```html title="src/app.html"
|
|
44
|
+
<script>
|
|
45
|
+
const pref = localStorage.getItem('axerity-theme') ?? 'light'; // was 'dark'
|
|
46
|
+
</script>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The second one is the no-flash script that sets the theme **before paint**, keep
|
|
50
|
+
it in sync with the default or the page will flash on load.
|
|
51
|
+
|
|
52
|
+
## Add your own token
|
|
53
|
+
|
|
54
|
+
Need a new semantic color, say a highlight background? Add it in three steps:
|
|
55
|
+
|
|
56
|
+
```css title="src/routes/layout.css"
|
|
57
|
+
:root {
|
|
58
|
+
--highlight: oklch(0.95 0.05 95);
|
|
59
|
+
}
|
|
60
|
+
.dark {
|
|
61
|
+
--highlight: oklch(0.3 0.05 95);
|
|
62
|
+
}
|
|
63
|
+
@theme inline {
|
|
64
|
+
--color-highlight: var(--highlight); /* now usable as bg-highlight, text-highlight */
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## A whole new named theme
|
|
69
|
+
|
|
70
|
+
The default light/dark live on `:root` and `.dark`. To ship **additional**
|
|
71
|
+
themes (e.g. a "sepia" reading mode), override the tokens under a `data-theme`
|
|
72
|
+
attribute and set it on `<html>`:
|
|
73
|
+
|
|
74
|
+
```css title="src/routes/layout.css"
|
|
75
|
+
[data-theme='sepia'] {
|
|
76
|
+
--bg: oklch(0.96 0.02 85);
|
|
77
|
+
--surface: oklch(0.98 0.015 85);
|
|
78
|
+
--fg: oklch(0.28 0.03 70);
|
|
79
|
+
--accent: oklch(0.5 0.12 50);
|
|
80
|
+
/* …override the rest of the semantic tokens… */
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
```ts title="apply it"
|
|
85
|
+
document.documentElement.dataset.theme = 'sepia';
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Because components read only semantic tokens, a complete new theme is just a new
|
|
89
|
+
block of variable values, no component changes.
|
|
90
|
+
|
|
91
|
+
<Callout type="tip">
|
|
92
|
+
|
|
93
|
+
This is exactly how the default `.dark` block works. A named theme is the same
|
|
94
|
+
idea with a different selector.
|
|
95
|
+
|
|
96
|
+
</Callout>
|
|
97
|
+
|
|
98
|
+
## Restyle the prose
|
|
99
|
+
|
|
100
|
+
Rendered Markdown is styled under `.doc-content` in `src/routes/layout.css`,
|
|
101
|
+
headings, links, tables, blockquotes, inline code. Adjust spacing, sizes, or
|
|
102
|
+
weights there to change how content reads. For example, tighten heading rhythm:
|
|
103
|
+
|
|
104
|
+
```css title="src/routes/layout.css"
|
|
105
|
+
.doc-content h2 {
|
|
106
|
+
margin-top: 2rem;
|
|
107
|
+
font-size: 1.4rem;
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
<Callout type="warning">
|
|
112
|
+
|
|
113
|
+
Keep edits in `.doc-content` and the token blocks. Touching individual component
|
|
114
|
+
files is rarely needed, and makes future updates harder to merge.
|
|
115
|
+
|
|
116
|
+
</Callout>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Code blocks
|
|
3
|
+
description: Change the syntax-highlighting theme.
|
|
4
|
+
icon: code
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import { Callout } from '$lib';
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
# Code block themes
|
|
12
|
+
|
|
13
|
+
Code is highlighted with [Shiki](https://shiki.style) using a **dual theme**,
|
|
14
|
+
one for light, one for dark, configured in `mdsvex.config.js`.
|
|
15
|
+
|
|
16
|
+
```js title="mdsvex.config.js"
|
|
17
|
+
const themes = { light: 'github-light', dark: 'vesper' };
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Pick any [bundled Shiki theme](https://shiki.style/themes) for each side:
|
|
21
|
+
|
|
22
|
+
```js title="mdsvex.config.js"
|
|
23
|
+
const themes = { light: 'min-light', dark: 'github-dark-default' };
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
<Callout type="warning">
|
|
27
|
+
|
|
28
|
+
`mdsvex.config.js` is read at build time, so **restart the dev server** after
|
|
29
|
+
changing themes, Vite doesn't hot-reload it.
|
|
30
|
+
|
|
31
|
+
</Callout>
|
|
32
|
+
|
|
33
|
+
## Block background
|
|
34
|
+
|
|
35
|
+
Shiki inlines each theme's own background, but Axerity overrides it with the
|
|
36
|
+
`--surface-raised` token so code blocks match cards and panels. That rule is in
|
|
37
|
+
`src/routes/layout.css`:
|
|
38
|
+
|
|
39
|
+
```css title="src/routes/layout.css"
|
|
40
|
+
.doc-content pre.shiki {
|
|
41
|
+
background-color: var(--surface-raised) !important;
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Remove the override if you'd rather keep the Shiki theme's native background.
|
|
46
|
+
|
|
47
|
+
## Languages
|
|
48
|
+
|
|
49
|
+
Grammars are preloaded in `mdsvex.config.js`. Add any language you use:
|
|
50
|
+
|
|
51
|
+
```js title="mdsvex.config.js"
|
|
52
|
+
const langs = ['svelte', 'typescript', 'javascript', 'json', 'bash', 'css', 'python'];
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Unlisted languages fall back to plain text.
|
|
56
|
+
|
|
57
|
+
## Fence options
|
|
58
|
+
|
|
59
|
+
Authors get titles, line highlighting, and line numbers out of the box:
|
|
60
|
+
|
|
61
|
+
````md
|
|
62
|
+
```ts title="example.ts" {2} showLineNumbers
|
|
63
|
+
const a = 1;
|
|
64
|
+
const b = 2; // highlighted
|
|
65
|
+
```
|
|
66
|
+
````
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Colors
|
|
3
|
+
description: Change the accent and surface palette.
|
|
4
|
+
icon: palette
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import { Callout } from '$lib';
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
# Colors
|
|
12
|
+
|
|
13
|
+
All colors are defined as [oklch](https://oklch.com) values on `:root` and
|
|
14
|
+
`.dark` in `src/routes/layout.css`. oklch is `lightness chroma hue`, it keeps
|
|
15
|
+
colors perceptually even, which makes building a balanced scale much easier.
|
|
16
|
+
|
|
17
|
+
## From the config
|
|
18
|
+
|
|
19
|
+
You do not have to touch CSS to set a brand color. Add a `brand` block to
|
|
20
|
+
`axerity.json` and it overrides the active theme's accent and corner radius in
|
|
21
|
+
both light and dark:
|
|
22
|
+
|
|
23
|
+
```json title="axerity.json"
|
|
24
|
+
{
|
|
25
|
+
"brand": {
|
|
26
|
+
"accent": "#6d5efc",
|
|
27
|
+
"radius": "0.75rem"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`accent` takes any CSS color (hex, `rgb()`, `oklch()`). `radius` sets the base
|
|
33
|
+
corner rounding. For anything beyond the accent, edit the tokens below.
|
|
34
|
+
|
|
35
|
+
## Change the accent
|
|
36
|
+
|
|
37
|
+
The accent drives links, active sidebar items, focus states, and highlights.
|
|
38
|
+
Set `--accent` (and its hover / contrast pair) in both themes:
|
|
39
|
+
|
|
40
|
+
```css title="src/routes/layout.css"
|
|
41
|
+
:root {
|
|
42
|
+
--accent: oklch(0.55 0.22 264); /* blue */
|
|
43
|
+
--accent-hover: oklch(0.62 0.2 264);
|
|
44
|
+
--accent-contrast: oklch(0.99 0 0); /* text on a solid accent */
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.dark {
|
|
48
|
+
--accent: oklch(0.7 0.16 264); /* lighter on dark */
|
|
49
|
+
--accent-hover: oklch(0.76 0.14 264);
|
|
50
|
+
--accent-contrast: oklch(0.18 0.02 264);
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
<Callout type="tip">
|
|
55
|
+
|
|
56
|
+
Use a **lighter, less saturated** accent in dark mode than in light, high
|
|
57
|
+
chroma on a dark background is harsh. Bumping lightness by ~0.15 is a good start.
|
|
58
|
+
|
|
59
|
+
</Callout>
|
|
60
|
+
|
|
61
|
+
## Change the surfaces
|
|
62
|
+
|
|
63
|
+
Surfaces and text are neutral by default (`chroma 0`). To tint the whole UI,
|
|
64
|
+
say, a cool slate, give every neutral token a small chroma at a shared hue:
|
|
65
|
+
|
|
66
|
+
```css title="src/routes/layout.css"
|
|
67
|
+
.dark {
|
|
68
|
+
--bg: oklch(0.16 0.015 264);
|
|
69
|
+
--bg-subtle: oklch(0.2 0.018 264);
|
|
70
|
+
--surface: oklch(0.21 0.018 264);
|
|
71
|
+
--surface-raised: oklch(0.24 0.02 264);
|
|
72
|
+
--fg: oklch(0.96 0.01 264);
|
|
73
|
+
--fg-muted: oklch(0.72 0.015 264);
|
|
74
|
+
--border: oklch(0.28 0.015 264);
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Keep the **lightness** values close to the defaults, they're tuned for
|
|
79
|
+
contrast. Adjust **chroma** and **hue** to set the mood.
|
|
80
|
+
|
|
81
|
+
## The brand gradient
|
|
82
|
+
|
|
83
|
+
The signature gradient (used for accents and marks) is one variable:
|
|
84
|
+
|
|
85
|
+
```css title="src/routes/layout.css"
|
|
86
|
+
:root {
|
|
87
|
+
--brand-gradient: linear-gradient(135deg, oklch(0.55 0.22 264), oklch(0.6 0.2 300));
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Semantic colors
|
|
92
|
+
|
|
93
|
+
Component accent colors (Callout variants, API method badges) are intentionally
|
|
94
|
+
**not** tied to `--accent`, they stay semantic (green = success, red = danger)
|
|
95
|
+
so meaning survives any accent change. Adjust them in their components if needed:
|
|
96
|
+
`src/lib/components/kit/Callout.svelte` and `…/api/Endpoint.svelte`.
|
|
97
|
+
|
|
98
|
+
<Callout type="warning">
|
|
99
|
+
|
|
100
|
+
Always check both light **and** dark after a color change, a value that reads
|
|
101
|
+
well on one can fail on the other.
|
|
102
|
+
|
|
103
|
+
</Callout>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Theming overview
|
|
3
|
+
description: How Axerity's design-token system works.
|
|
4
|
+
icon: palette
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import { Callout } from '$lib';
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
# Theming
|
|
12
|
+
|
|
13
|
+
Axerity is themed entirely through **CSS custom properties** (design tokens). Every
|
|
14
|
+
color, font, radius, and layout rail is a token, components never reference raw
|
|
15
|
+
values, so changing a handful of variables re-themes the whole site, light and
|
|
16
|
+
dark, in one place.
|
|
17
|
+
|
|
18
|
+
Everything lives in **`src/routes/layout.css`**.
|
|
19
|
+
|
|
20
|
+
## The two layers
|
|
21
|
+
|
|
22
|
+
Theming is split into two layers:
|
|
23
|
+
|
|
24
|
+
1. **Semantic tokens**, `--bg`, `--fg`, `--accent`, `--border`… defined on
|
|
25
|
+
`:root` (light) and overridden on `.dark` (dark). This is what you edit.
|
|
26
|
+
2. **Tailwind bridge**, an `@theme inline` block maps those tokens onto Tailwind
|
|
27
|
+
utilities (`bg-bg`, `text-fg`, `border-border`, `rounded-lg`, …) so components
|
|
28
|
+
can use them as normal classes.
|
|
29
|
+
|
|
30
|
+
```css title="src/routes/layout.css"
|
|
31
|
+
:root {
|
|
32
|
+
--bg: oklch(1 0 0);
|
|
33
|
+
--fg: oklch(0.205 0 0);
|
|
34
|
+
--accent: oklch(0.205 0 0);
|
|
35
|
+
/* …all light values… */
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.dark {
|
|
39
|
+
--bg: oklch(0.145 0 0);
|
|
40
|
+
--fg: oklch(0.985 0 0);
|
|
41
|
+
--accent: oklch(0.922 0 0);
|
|
42
|
+
/* …dark overrides… */
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@theme inline {
|
|
46
|
+
--color-bg: var(--bg);
|
|
47
|
+
--color-fg: var(--fg);
|
|
48
|
+
--color-accent: var(--accent);
|
|
49
|
+
/* …exposes bg-bg / text-fg / text-accent / … to Tailwind… */
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## The semantic tokens
|
|
54
|
+
|
|
55
|
+
| Token | Used for |
|
|
56
|
+
| ------------------- | ---------------------------------------- |
|
|
57
|
+
| `--bg` | Page background |
|
|
58
|
+
| `--bg-subtle` | Muted background (headers, hover) |
|
|
59
|
+
| `--surface` | Card / panel background |
|
|
60
|
+
| `--surface-raised` | Elevated surfaces (code blocks) |
|
|
61
|
+
| `--fg` | Primary text |
|
|
62
|
+
| `--fg-muted` | Body / secondary text |
|
|
63
|
+
| `--fg-subtle` | Tertiary text, labels |
|
|
64
|
+
| `--border` | Default borders |
|
|
65
|
+
| `--border-strong` | Emphasized borders |
|
|
66
|
+
| `--accent` | Accent, links, active states, highlights |
|
|
67
|
+
| `--accent-hover` | Accent hover state |
|
|
68
|
+
| `--accent-contrast` | Text on a solid accent background |
|
|
69
|
+
| `--brand-gradient` | The signature gradient |
|
|
70
|
+
|
|
71
|
+
<Callout type="tip">
|
|
72
|
+
|
|
73
|
+
Because components only use these tokens, you almost never edit a component to
|
|
74
|
+
re-theme, you edit the tokens.
|
|
75
|
+
|
|
76
|
+
</Callout>
|
|
77
|
+
|
|
78
|
+
## The default theme
|
|
79
|
+
|
|
80
|
+
Out of the box Axerity ships a **neutral (shadcn-style)** theme: pure grayscale
|
|
81
|
+
surfaces, a monochrome accent, and **dark by default**. The next pages show how
|
|
82
|
+
to make it yours.
|
|
83
|
+
|
|
84
|
+
- [Colors](/theming/colors), accent and surfaces
|
|
85
|
+
- [Typography](/theming/typography), fonts
|
|
86
|
+
- [Layout](/theming/layout), widths and rails
|
|
87
|
+
- [Code blocks](/theming/code), syntax themes
|
|
88
|
+
- [Advanced](/theming/advanced), radius, custom tokens, full themes
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Layout
|
|
3
|
+
description: Control widths, rails, and the page shell.
|
|
4
|
+
icon: layout-grid
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import { Callout } from '$lib';
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
# Layout
|
|
12
|
+
|
|
13
|
+
## Flat vs boxed
|
|
14
|
+
|
|
15
|
+
The overall shell has two modes, set in `src/lib/config/site.ts`:
|
|
16
|
+
|
|
17
|
+
```ts title="src/lib/config/site.ts"
|
|
18
|
+
export const site: SiteConfig = {
|
|
19
|
+
name: 'Axerity',
|
|
20
|
+
layout: 'flat' // 'flat' (full-bleed, sidebar at the edge) or 'boxed' (centered)
|
|
21
|
+
};
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
- **`flat`** _(default)_, the sidebar sits flush at the left edge and the shell
|
|
25
|
+
spans the viewport.
|
|
26
|
+
- **`boxed`**, the whole shell (navbar + columns) centers in a max-width
|
|
27
|
+
container on wide screens.
|
|
28
|
+
|
|
29
|
+
## Layout rails
|
|
30
|
+
|
|
31
|
+
The widths of the shell's columns are tokens in the `@theme` block. Tune them to
|
|
32
|
+
taste:
|
|
33
|
+
|
|
34
|
+
```css title="src/routes/layout.css"
|
|
35
|
+
@theme inline {
|
|
36
|
+
--spacing-sidebar: 17rem; /* left navigation */
|
|
37
|
+
--spacing-toc: 15rem; /* right table of contents */
|
|
38
|
+
--spacing-header: 4rem; /* sticky navbar height */
|
|
39
|
+
--spacing-content: 48rem; /* reading width of doc pages */
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`--spacing-content` is the most impactful, it sets the line length of prose.
|
|
44
|
+
17rem ≈ 272px sidebar, 48rem ≈ 768px content.
|
|
45
|
+
|
|
46
|
+
## The API layout
|
|
47
|
+
|
|
48
|
+
Pages with `layout: api` in their frontmatter switch to a **wide, TOC-less**
|
|
49
|
+
two-column layout (content on the left, sticky request/response samples on the
|
|
50
|
+
right):
|
|
51
|
+
|
|
52
|
+
```md title="content/docs/api/get-user.md"
|
|
53
|
+
---
|
|
54
|
+
title: Get a user
|
|
55
|
+
layout: api
|
|
56
|
+
---
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
<Callout type="tip">
|
|
60
|
+
|
|
61
|
+
Set `defaultOpen: true` in a folder's `meta.json` to keep that sidebar group
|
|
62
|
+
expanded by default, handy for an API section.
|
|
63
|
+
|
|
64
|
+
</Callout>
|
|
65
|
+
|
|
66
|
+
## The three columns
|
|
67
|
+
|
|
68
|
+
The shell is sidebar / content / table-of-contents. The TOC auto-hides below the
|
|
69
|
+
`xl` breakpoint and in API mode; the sidebar collapses into a drawer below `lg`.
|
|
70
|
+
The structure lives in `src/lib/components/docs/DocsLayout.svelte` if you need to
|
|
71
|
+
restructure it.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Themes
|
|
3
|
+
description: Eight built-in presets inspired by well-known docs.
|
|
4
|
+
icon: palette
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Themes
|
|
8
|
+
|
|
9
|
+
A theme is a complete palette: backgrounds, text, borders, and an accent, with a
|
|
10
|
+
matching dark mode. Pick one in `axerity.json`:
|
|
11
|
+
|
|
12
|
+
```json
|
|
13
|
+
{
|
|
14
|
+
"theme": "stripe"
|
|
15
|
+
}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Leave it out (or use `"neutral"`) for the default grayscale look. The theme is
|
|
19
|
+
applied on the server, so there is no flash on load, and dark mode works with
|
|
20
|
+
every preset.
|
|
21
|
+
|
|
22
|
+
## Your own brand
|
|
23
|
+
|
|
24
|
+
Not tied to the presets. Set `brand` to drop in your own accent and corners on
|
|
25
|
+
top of any `theme` (the accent drives links, active items, buttons, and the
|
|
26
|
+
sidebar tint):
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"theme": "neutral",
|
|
31
|
+
"brand": {
|
|
32
|
+
"accent": "#ff5722",
|
|
33
|
+
"radius": "0.75rem"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
| Field | Description |
|
|
39
|
+
| ---------------- | ------------------------------------------ |
|
|
40
|
+
| `accent` | Accent color, any CSS color |
|
|
41
|
+
| `accentDark` | Accent in dark mode (defaults to `accent`) |
|
|
42
|
+
| `accentContrast` | Text color on the accent (default white) |
|
|
43
|
+
| `radius` | Base corner radius, e.g. `0.5rem` |
|
|
44
|
+
|
|
45
|
+
Brand values win over the preset, so `neutral` plus your accent gives a clean,
|
|
46
|
+
on-brand site. Pick a colored preset for a fuller reskin.
|
|
47
|
+
|
|
48
|
+
## Presets
|
|
49
|
+
|
|
50
|
+
Each preset is tuned after a product's documentation. Set the `theme` value to
|
|
51
|
+
the name on the left.
|
|
52
|
+
|
|
53
|
+
| Theme | Accent | Feel |
|
|
54
|
+
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- |
|
|
55
|
+
| `neutral` | <span style="display:inline-block;width:14px;height:14px;border-radius:9999px;background:oklch(0.4 0 0);vertical-align:middle"></span> Grayscale | Quiet monochrome, the default |
|
|
56
|
+
| `stripe` | <span style="display:inline-block;width:14px;height:14px;border-radius:9999px;background:oklch(0.55 0.23 274);vertical-align:middle"></span> Indigo | Airy and light with soft corners |
|
|
57
|
+
| `vercel` | <span style="display:inline-block;width:14px;height:14px;border-radius:9999px;background:oklch(0.18 0 0);vertical-align:middle"></span> Black/white | Maximum contrast, sharp corners |
|
|
58
|
+
| `linear` | <span style="display:inline-block;width:14px;height:14px;border-radius:9999px;background:oklch(0.55 0.16 277);vertical-align:middle"></span> Violet | Cool grays, dense, great in dark |
|
|
59
|
+
| `supabase` | <span style="display:inline-block;width:14px;height:14px;border-radius:9999px;background:oklch(0.76 0.16 162);vertical-align:middle"></span> Green | Dark-first with a bright green accent |
|
|
60
|
+
| `github` | <span style="display:inline-block;width:14px;height:14px;border-radius:9999px;background:oklch(0.52 0.18 256);vertical-align:middle"></span> Blue | Primer blue and the system font |
|
|
61
|
+
| `tailwind` | <span style="display:inline-block;width:14px;height:14px;border-radius:9999px;background:oklch(0.68 0.15 233);vertical-align:middle"></span> Sky | Slate grays and rounded corners |
|
|
62
|
+
| `mintlify` | <span style="display:inline-block;width:14px;height:14px;border-radius:9999px;background:oklch(0.62 0.16 150);vertical-align:middle"></span> Emerald | Friendly, light, and rounded |
|
|
63
|
+
| `anthropic` | <span style="display:inline-block;width:14px;height:14px;border-radius:9999px;background:oklch(0.62 0.13 42);vertical-align:middle"></span> Clay | Warm accent on an ivory page |
|
|
64
|
+
|
|
65
|
+
## Layout
|
|
66
|
+
|
|
67
|
+
The `theme` controls color, type, and corners. The `layout` controls the shape
|
|
68
|
+
of the page and is set separately:
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"theme": "stripe",
|
|
73
|
+
"layout": "boxed"
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
- `flat` puts the sidebar flush against the left edge and fills the screen.
|
|
78
|
+
- `boxed` centers the whole site in a max-width container on wide screens.
|
|
79
|
+
|
|
80
|
+
Mix and match. Stripe and Tailwind feel at home boxed; Vercel and Linear suit
|
|
81
|
+
the flat, full-width look.
|
|
82
|
+
|
|
83
|
+
## Sidebar
|
|
84
|
+
|
|
85
|
+
Choose how the sidebar is presented with `sidebar.variant`:
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"sidebar": { "variant": "floating" }
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
- `flush` is the default: a tinted panel against the edge with a divider.
|
|
94
|
+
- `card` insets the sidebar as a bordered, rounded panel.
|
|
95
|
+
- `floating` detaches it into a rounded, shadowed card that floats in the
|
|
96
|
+
margin.
|
|
97
|
+
|
|
98
|
+
All three pick up the theme's accent tint, so a floating Supabase sidebar reads
|
|
99
|
+
green while a floating Stripe one reads indigo.
|