@whatsaaaa/design-system 0.0.0 → 0.1.1
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/README.md +151 -0
- package/assets/building-blocks/apple-touch-icon.png +0 -0
- package/assets/building-blocks/favicon-16.png +0 -0
- package/assets/building-blocks/favicon-32.png +0 -0
- package/assets/building-blocks/favicon.ico +0 -0
- package/assets/building-blocks/favicon.svg +1 -0
- package/assets/building-blocks/icon-192.png +0 -0
- package/assets/building-blocks/icon-512.png +0 -0
- package/assets/building-blocks/lockup-dark.svg +1 -0
- package/assets/building-blocks/lockup-light.svg +1 -0
- package/assets/building-blocks/mark-mono.svg +1 -0
- package/assets/building-blocks/mark-on-dark.svg +1 -0
- package/assets/building-blocks/mark-on-light.svg +1 -0
- package/assets/building-blocks/mark.svg +1 -0
- package/assets/building-blocks/readme-header.png +0 -0
- package/assets/building-blocks/readme-header.svg +1 -0
- package/assets/building-blocks/social-card.png +0 -0
- package/assets/building-blocks/social-card.svg +1 -0
- package/assets/building-blocks/wordmark-dark.svg +1 -0
- package/assets/building-blocks/wordmark-light.svg +1 -0
- package/assets/dotfiles/apple-touch-icon.png +0 -0
- package/assets/dotfiles/favicon-16.png +0 -0
- package/assets/dotfiles/favicon-32.png +0 -0
- package/assets/dotfiles/favicon.ico +0 -0
- package/assets/dotfiles/favicon.svg +1 -0
- package/assets/dotfiles/icon-192.png +0 -0
- package/assets/dotfiles/icon-512.png +0 -0
- package/assets/dotfiles/lockup-dark.svg +1 -0
- package/assets/dotfiles/lockup-light.svg +1 -0
- package/assets/dotfiles/mark-mono.svg +1 -0
- package/assets/dotfiles/mark-on-dark.svg +1 -0
- package/assets/dotfiles/mark-on-light.svg +1 -0
- package/assets/dotfiles/mark.svg +1 -0
- package/assets/dotfiles/readme-header.png +0 -0
- package/assets/dotfiles/readme-header.svg +1 -0
- package/assets/dotfiles/social-card.png +0 -0
- package/assets/dotfiles/social-card.svg +1 -0
- package/assets/dotfiles/wordmark-dark.svg +1 -0
- package/assets/dotfiles/wordmark-light.svg +1 -0
- package/assets/form-builder/apple-touch-icon.png +0 -0
- package/assets/form-builder/favicon-16.png +0 -0
- package/assets/form-builder/favicon-32.png +0 -0
- package/assets/form-builder/favicon.ico +0 -0
- package/assets/form-builder/favicon.svg +1 -0
- package/assets/form-builder/icon-192.png +0 -0
- package/assets/form-builder/icon-512.png +0 -0
- package/assets/form-builder/lockup-dark.svg +1 -0
- package/assets/form-builder/lockup-light.svg +1 -0
- package/assets/form-builder/mark-mono.svg +1 -0
- package/assets/form-builder/mark-on-dark.svg +1 -0
- package/assets/form-builder/mark-on-light.svg +1 -0
- package/assets/form-builder/mark.svg +1 -0
- package/assets/form-builder/readme-header.png +0 -0
- package/assets/form-builder/readme-header.svg +1 -0
- package/assets/form-builder/social-card.png +0 -0
- package/assets/form-builder/social-card.svg +1 -0
- package/assets/form-builder/wordmark-dark.svg +1 -0
- package/assets/form-builder/wordmark-light.svg +1 -0
- package/assets/manifest.json +541 -0
- package/assets/whatsaaaa/apple-touch-icon.png +0 -0
- package/assets/whatsaaaa/favicon-16.png +0 -0
- package/assets/whatsaaaa/favicon-32.png +0 -0
- package/assets/whatsaaaa/favicon.ico +0 -0
- package/assets/whatsaaaa/favicon.svg +1 -0
- package/assets/whatsaaaa/icon-192.png +0 -0
- package/assets/whatsaaaa/icon-512.png +0 -0
- package/assets/whatsaaaa/lockup-dark.svg +1 -0
- package/assets/whatsaaaa/lockup-light.svg +1 -0
- package/assets/whatsaaaa/mark-mono.svg +1 -0
- package/assets/whatsaaaa/mark-on-dark.svg +1 -0
- package/assets/whatsaaaa/mark-on-light.svg +1 -0
- package/assets/whatsaaaa/mark.svg +1 -0
- package/assets/whatsaaaa/pose-blink-dark.svg +1 -0
- package/assets/whatsaaaa/pose-blink-light.svg +1 -0
- package/assets/whatsaaaa/pose-idle-dark.svg +1 -0
- package/assets/whatsaaaa/pose-idle-light.svg +1 -0
- package/assets/whatsaaaa/pose-lost-dark.svg +1 -0
- package/assets/whatsaaaa/pose-lost-light.svg +1 -0
- package/assets/whatsaaaa/pose-shout-dark.svg +1 -0
- package/assets/whatsaaaa/pose-shout-light.svg +1 -0
- package/assets/whatsaaaa/pose-wag-left-dark.svg +1 -0
- package/assets/whatsaaaa/pose-wag-left-light.svg +1 -0
- package/assets/whatsaaaa/pose-wag-right-dark.svg +1 -0
- package/assets/whatsaaaa/pose-wag-right-light.svg +1 -0
- package/assets/whatsaaaa/readme-header.png +0 -0
- package/assets/whatsaaaa/readme-header.svg +1 -0
- package/assets/whatsaaaa/social-card.png +0 -0
- package/assets/whatsaaaa/social-card.svg +1 -0
- package/assets/whatsaaaa/wordmark-dark.svg +1 -0
- package/assets/whatsaaaa/wordmark-light.svg +1 -0
- package/dist/color.d.ts +5 -0
- package/dist/color.js +7 -0
- package/dist/css/base.css +50 -0
- package/dist/css/callout.css +64 -0
- package/dist/css/code.css +50 -0
- package/dist/css/ghost.css +93 -0
- package/dist/css/icons.css +8 -0
- package/dist/css/prose.css +320 -0
- package/dist/css/terminal.css +424 -0
- package/dist/fonts/inter-latin-ext-wght-italic.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-wght-italic.woff2 +0 -0
- package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/inter.OFL.txt +93 -0
- package/dist/fonts/jetbrains-mono-latin-ext-wght-italic.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-latin-wght-italic.woff2 +0 -0
- package/dist/fonts/jetbrains-mono-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/jetbrains-mono.OFL.txt +93 -0
- package/dist/fonts.css +85 -0
- package/dist/ghost/bubble.d.ts +16 -0
- package/dist/ghost/bubble.js +50 -0
- package/dist/ghost/glyphs.d.ts +12 -0
- package/dist/ghost/glyphs.js +19 -0
- package/dist/ghost/index.d.ts +57 -0
- package/dist/ghost/index.js +227 -0
- package/dist/identity/ghost.d.ts +28 -0
- package/dist/identity/ghost.js +129 -0
- package/dist/identity/marks.d.ts +48 -0
- package/dist/identity/marks.js +52 -0
- package/dist/identity/sprite.d.ts +43 -0
- package/dist/identity/sprite.js +100 -0
- package/dist/index.css +1404 -0
- package/dist/shiki/index.d.ts +20 -0
- package/dist/shiki/index.js +64 -0
- package/dist/shortcuts/index.d.ts +48 -0
- package/dist/shortcuts/index.js +155 -0
- package/dist/shortcuts/init.js +2 -0
- package/dist/theme/index.d.ts +24 -0
- package/dist/theme/index.js +60 -0
- package/dist/theme/init.js +2 -0
- package/dist/tokens.css +537 -0
- package/dist/tokens.d.ts +194 -0
- package/dist/tokens.js +336 -0
- package/dist/vitepress-config/index.d.ts +16 -0
- package/dist/vitepress-config/index.js +36 -0
- package/dist/vitepress-config/markdown.d.ts +6 -0
- package/dist/vitepress-config/markdown.js +50 -0
- package/dist/vitepress-config/types.d.ts +16 -0
- package/dist/vitepress-config/types.js +1 -0
- package/docs/usage.md +226 -0
- package/licenses/README.md +10 -0
- package/licenses/departure-mono.OFL.txt +93 -0
- package/licenses/rose-pine-palette.LICENSE +21 -0
- package/package.json +155 -3
- package/src/vitepress/Layout.vue +77 -0
- package/src/vitepress/components/Crumb.vue +32 -0
- package/src/vitepress/components/NavGhost.vue +23 -0
- package/src/vitepress/components/NotFound.vue +22 -0
- package/src/vitepress/components/StatusLine.vue +128 -0
- package/src/vitepress/env.d.ts +2 -0
- package/src/vitepress/index.ts +34 -0
- package/src/vitepress/path.ts +19 -0
- package/src/vitepress/styles/doc.css +385 -0
- package/src/vitepress/styles/home.css +47 -0
- package/src/vitepress/styles/layout.css +97 -0
- package/src/vitepress/styles/nav.css +441 -0
- package/src/vitepress/styles/search.css +55 -0
- package/src/vitepress/styles/sidebar.css +173 -0
- package/src/vitepress/styles/vars.css +204 -0
- package/src/vitepress/support.ts +15 -0
- package/src/vitepress/theme.d.ts +8 -0
- package/tokens/contrast.json +271 -0
- package/tokens/core.tokens.json +743 -0
- package/tokens/palette.tokens.json +222 -0
- package/tokens/theme-dark.tokens.json +146 -0
- package/tokens/theme-light.tokens.json +146 -0
- package/tokens/whatsaaaa.resolver.json +43 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useData, withBase } from 'vitepress'
|
|
3
|
+
import { ghostSvg } from '../../../dist/ghost/index.js'
|
|
4
|
+
import { usePagePath } from '../path.ts'
|
|
5
|
+
|
|
6
|
+
const { site } = useData()
|
|
7
|
+
const path = usePagePath()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div class="WsNotFound">
|
|
12
|
+
<!-- eslint-disable-next-line vue/no-v-html -- markup built by the ghost module, no user input -->
|
|
13
|
+
<div class="WsNotFound-ghost" v-html="ghostSvg({ px: 8, pose: 'lost' })" />
|
|
14
|
+
<h1 class="WsNotFound-title">404</h1>
|
|
15
|
+
<p class="ws-prompt">cat /{{ path.replace(/\.md$/, '') }}</p>
|
|
16
|
+
<p class="WsNotFound-output">No such file or directory</p>
|
|
17
|
+
<p class="ws-prompt">
|
|
18
|
+
<a :href="withBase(site.localeIndex === 'root' ? '/' : `/${site.localeIndex}/`)">cd ~</a>
|
|
19
|
+
<span class="ws-prompt__comment"># back to the start</span>
|
|
20
|
+
</p>
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useData } from 'vitepress'
|
|
3
|
+
import { computed, onMounted, onUnmounted, ref } from 'vue'
|
|
4
|
+
import { isTyping } from '../../../dist/shortcuts/index.js'
|
|
5
|
+
import type { ThemeConfig } from '../../../dist/vitepress-config/types.js'
|
|
6
|
+
import { usePagePath } from '../path.ts'
|
|
7
|
+
|
|
8
|
+
const { theme, isDark } = useData<ThemeConfig>()
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* NORMAL while single keys are shortcuts, INSERT while they are typed into a field.
|
|
12
|
+
* It says whether the key hints next to it work right now.
|
|
13
|
+
*/
|
|
14
|
+
const mode = ref<'NORMAL' | 'INSERT'>('NORMAL')
|
|
15
|
+
/** Where the page is scrolled to, the way an editor shows it: top, a percentage, bot. */
|
|
16
|
+
const position = ref('top')
|
|
17
|
+
|
|
18
|
+
const hasSearch = computed(() => !!theme.value.search?.provider)
|
|
19
|
+
/** The file of the page. Not known yet on the first render of a page that is not there. */
|
|
20
|
+
const file = usePagePath()
|
|
21
|
+
|
|
22
|
+
function updateMode() {
|
|
23
|
+
mode.value = isTyping(document.activeElement) ? 'INSERT' : 'NORMAL'
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function updatePosition() {
|
|
27
|
+
const scrollable = document.documentElement.scrollHeight - window.innerHeight
|
|
28
|
+
if (scrollable <= 0 || window.scrollY <= 0) position.value = 'top'
|
|
29
|
+
else if (window.scrollY >= scrollable - 1) position.value = 'bot'
|
|
30
|
+
else position.value = `${Math.round((window.scrollY / scrollable) * 100)}%`
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function openSearch() {
|
|
34
|
+
document.querySelector<HTMLButtonElement>('.VPNavBarSearch .DocSearch-Button')?.click()
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function scrollPage(direction: 1 | -1) {
|
|
38
|
+
const reduce = window.matchMedia('(prefers-reduced-motion: reduce)').matches
|
|
39
|
+
window.scrollBy({
|
|
40
|
+
top: direction * Math.round(window.innerHeight * 0.4),
|
|
41
|
+
behavior: reduce ? 'auto' : 'smooth',
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function toggleTheme() {
|
|
46
|
+
isDark.value = !isDark.value
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
onMounted(() => {
|
|
50
|
+
updateMode()
|
|
51
|
+
updatePosition()
|
|
52
|
+
document.addEventListener('focusin', updateMode)
|
|
53
|
+
document.addEventListener('focusout', updateMode)
|
|
54
|
+
window.addEventListener('scroll', updatePosition, { passive: true })
|
|
55
|
+
window.addEventListener('resize', updatePosition)
|
|
56
|
+
})
|
|
57
|
+
onUnmounted(() => {
|
|
58
|
+
document.removeEventListener('focusin', updateMode)
|
|
59
|
+
document.removeEventListener('focusout', updateMode)
|
|
60
|
+
window.removeEventListener('scroll', updatePosition)
|
|
61
|
+
window.removeEventListener('resize', updatePosition)
|
|
62
|
+
})
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<template>
|
|
66
|
+
<footer class="ws-status-line WsStatusLine" aria-label="Status">
|
|
67
|
+
<span class="ws-status-line__mode">{{ mode }}</span>
|
|
68
|
+
<span v-if="file" class="ws-status-line__file"><span>{{ file }}</span></span>
|
|
69
|
+
<span v-if="theme.whatsaaaa?.branch" class="ws-status-line__item ws-status-line__item--wide">
|
|
70
|
+
{{ theme.whatsaaaa.branch }}
|
|
71
|
+
</span>
|
|
72
|
+
<span class="ws-status-line__spacer" />
|
|
73
|
+
<!-- Each hint is the control it names: the key clicks the button. -->
|
|
74
|
+
<span class="ws-status-line__keys">
|
|
75
|
+
<button
|
|
76
|
+
v-if="hasSearch"
|
|
77
|
+
type="button"
|
|
78
|
+
data-ws-key="/"
|
|
79
|
+
aria-label="Search"
|
|
80
|
+
@click="openSearch"
|
|
81
|
+
>
|
|
82
|
+
<kbd class="ws-kbd">/</kbd>search
|
|
83
|
+
</button>
|
|
84
|
+
<span class="WsStatusLine-pair">
|
|
85
|
+
<button type="button" data-ws-key="j" aria-label="Scroll down" @click="scrollPage(1)">
|
|
86
|
+
<kbd class="ws-kbd">j</kbd>
|
|
87
|
+
</button>
|
|
88
|
+
<button type="button" data-ws-key="k" aria-label="Scroll up" @click="scrollPage(-1)">
|
|
89
|
+
<kbd class="ws-kbd">k</kbd>
|
|
90
|
+
</button>
|
|
91
|
+
<span aria-hidden="true">scroll</span>
|
|
92
|
+
</span>
|
|
93
|
+
<button type="button" data-ws-key="t" aria-label="Switch theme" @click="toggleTheme">
|
|
94
|
+
<kbd class="ws-kbd">t</kbd>theme
|
|
95
|
+
</button>
|
|
96
|
+
</span>
|
|
97
|
+
<!--
|
|
98
|
+
The shortcuts module flips this switch and gives it its state, in the browser. Until
|
|
99
|
+
then it is hidden, so nothing here depends on what the browser remembers.
|
|
100
|
+
-->
|
|
101
|
+
<button
|
|
102
|
+
type="button"
|
|
103
|
+
class="ws-status-line__switch"
|
|
104
|
+
role="switch"
|
|
105
|
+
aria-label="Shortcut keys"
|
|
106
|
+
data-ws-keys-switch
|
|
107
|
+
>
|
|
108
|
+
keys
|
|
109
|
+
<span class="ws-status-line__on" aria-hidden="true">on</span>
|
|
110
|
+
<span class="ws-status-line__off" aria-hidden="true">off</span>
|
|
111
|
+
</button>
|
|
112
|
+
<span class="ws-status-line__item ws-status-line__item--edge">{{ position }}</span>
|
|
113
|
+
<!--
|
|
114
|
+
Both names are rendered and the styles show the one of the page's theme. The theme is
|
|
115
|
+
not known on the server, so a name rendered from it would differ in the browser.
|
|
116
|
+
-->
|
|
117
|
+
<span
|
|
118
|
+
class="ws-status-line__item ws-status-line__item--edge ws-status-line__item--wide ws-status-line__item--dark"
|
|
119
|
+
>
|
|
120
|
+
rose-pine
|
|
121
|
+
</span>
|
|
122
|
+
<span
|
|
123
|
+
class="ws-status-line__item ws-status-line__item--edge ws-status-line__item--wide ws-status-line__item--light"
|
|
124
|
+
>
|
|
125
|
+
rose-pine-dawn
|
|
126
|
+
</span>
|
|
127
|
+
</footer>
|
|
128
|
+
</template>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The docs theme for VitePress. It extends VitePress's default theme, so a site keeps its
|
|
3
|
+
* nav, sidebar, search and every other default theme option, and gets the terminal frame:
|
|
4
|
+
* the tab bar, the status line with working keys, and the prose and code styles.
|
|
5
|
+
*
|
|
6
|
+
* In .vitepress/theme/index.ts:
|
|
7
|
+
*
|
|
8
|
+
* export { default } from '@whatsaaaa/design-system/vitepress'
|
|
9
|
+
*
|
|
10
|
+
* In .vitepress/config.ts, extend the base config from '@whatsaaaa/design-system/vitepress/config'.
|
|
11
|
+
*/
|
|
12
|
+
import type { Theme } from 'vitepress'
|
|
13
|
+
import DefaultTheme from 'vitepress/theme-without-fonts'
|
|
14
|
+
import '../../dist/fonts.css'
|
|
15
|
+
import '../../dist/tokens.css'
|
|
16
|
+
import '../../dist/css/icons.css'
|
|
17
|
+
import '../../dist/css/prose.css'
|
|
18
|
+
import '../../dist/css/terminal.css'
|
|
19
|
+
import '../../dist/css/ghost.css'
|
|
20
|
+
import './styles/vars.css'
|
|
21
|
+
import './styles/layout.css'
|
|
22
|
+
import './styles/nav.css'
|
|
23
|
+
import './styles/sidebar.css'
|
|
24
|
+
import './styles/doc.css'
|
|
25
|
+
import './styles/home.css'
|
|
26
|
+
import './styles/search.css'
|
|
27
|
+
import Layout from './Layout.vue'
|
|
28
|
+
|
|
29
|
+
export type { ThemeConfig, WhatsaaaaThemeConfig } from '../../dist/vitepress-config/types.js'
|
|
30
|
+
|
|
31
|
+
export default {
|
|
32
|
+
extends: DefaultTheme,
|
|
33
|
+
Layout,
|
|
34
|
+
} satisfies Theme
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useData } from 'vitepress'
|
|
2
|
+
import { computed, onMounted, ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The path of the page's file, for the parts of the theme that show it.
|
|
6
|
+
*
|
|
7
|
+
* For a page that is not there the server knows only 404.md, and the browser knows the
|
|
8
|
+
* address that was asked for. So on such a page the path is empty until the app is mounted:
|
|
9
|
+
* the first render in the browser equals what the server sent, and the page never names a
|
|
10
|
+
* path that is not the one in the address bar.
|
|
11
|
+
*/
|
|
12
|
+
export function usePagePath() {
|
|
13
|
+
const { page } = useData()
|
|
14
|
+
const mounted = ref(false)
|
|
15
|
+
onMounted(() => {
|
|
16
|
+
mounted.value = true
|
|
17
|
+
})
|
|
18
|
+
return computed(() => (page.value.isNotFound && !mounted.value ? '' : page.value.relativePath))
|
|
19
|
+
}
|
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The page content. The prose styles of the system already apply to .vp-doc. This file
|
|
3
|
+
* covers what VitePress renders in its own shape: heading permalinks, code blocks, custom
|
|
4
|
+
* blocks, the pager, and the few default theme rules that are more specific than prose.
|
|
5
|
+
*/
|
|
6
|
+
.WsCrumb {
|
|
7
|
+
margin-bottom: var(--ws-space-12);
|
|
8
|
+
text-transform: lowercase;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/* the permalink of a section is its hash, and hangs where the hash of a plain page does */
|
|
12
|
+
.vp-doc h2::before {
|
|
13
|
+
content: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.vp-doc h2 .header-anchor {
|
|
17
|
+
top: var(--ws-space-24);
|
|
18
|
+
left: 0;
|
|
19
|
+
margin: 0;
|
|
20
|
+
color: var(--ws-color-brand);
|
|
21
|
+
font-weight: inherit;
|
|
22
|
+
opacity: 1;
|
|
23
|
+
text-decoration: none;
|
|
24
|
+
transition: none;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.vp-doc :is(h1, h3, h4, h5, h6) .header-anchor {
|
|
28
|
+
color: var(--ws-color-brand);
|
|
29
|
+
font-weight: inherit;
|
|
30
|
+
text-decoration: none;
|
|
31
|
+
transition: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.vp-doc h2 .header-anchor::before {
|
|
35
|
+
content: '#';
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.vp-doc :is(h1, h2, h3, h4, h5, h6) {
|
|
39
|
+
outline-offset: 4px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.vp-doc a {
|
|
43
|
+
transition: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.vp-doc a:hover {
|
|
47
|
+
color: var(--ws-color-interactive);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.vp-doc :not(pre, h1, h2, h3, h4, h5, h6) > code {
|
|
51
|
+
font-size: 0.8125em;
|
|
52
|
+
transition: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.vp-doc tr:nth-child(2n) {
|
|
56
|
+
background: none;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* code blocks: a caption bar with the file name and the language, dark in both themes */
|
|
60
|
+
.vp-doc div[class*='language-'] {
|
|
61
|
+
--ws-caption: 2.25rem;
|
|
62
|
+
|
|
63
|
+
margin: var(--ws-space-16) 0 0;
|
|
64
|
+
padding-top: var(--ws-caption);
|
|
65
|
+
overflow: hidden;
|
|
66
|
+
border: var(--ws-border-width-thin) solid var(--ws-code-border);
|
|
67
|
+
border-radius: var(--ws-radius-lg);
|
|
68
|
+
background: var(--ws-code-bg);
|
|
69
|
+
color-scheme: dark;
|
|
70
|
+
transition: none;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* the default theme pulls a block up against the one before it. Here each keeps its own frame. */
|
|
74
|
+
.vp-doc div[class*='language-'] + div[class*='language-'],
|
|
75
|
+
.vp-doc div[class$='-api'] + div[class*='language-'],
|
|
76
|
+
.vp-doc div[class*='language-'] + div[class$='-api'] > div[class*='language-'] {
|
|
77
|
+
margin-top: var(--ws-space-16);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* the marks of a diff sit in the padding, left of the code */
|
|
81
|
+
.vp-doc div[class*='language-'] code .diff::before {
|
|
82
|
+
left: var(--ws-space-4);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.vp-doc div[class*='language-']::before {
|
|
86
|
+
position: absolute;
|
|
87
|
+
top: 0;
|
|
88
|
+
right: 0;
|
|
89
|
+
left: 0;
|
|
90
|
+
height: var(--ws-caption);
|
|
91
|
+
border-bottom: var(--ws-border-width-thin) solid var(--ws-code-border);
|
|
92
|
+
background: var(--ws-code-header-bg);
|
|
93
|
+
content: '';
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* a block with neither a file name nor a language has nothing to caption */
|
|
97
|
+
.vp-doc div[class*='language-']:has(> span.lang:empty):not(:has(> .ws-code-title)) {
|
|
98
|
+
--ws-caption: 0rem;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.vp-doc div[class*='language-']:has(> span.lang:empty):not(:has(> .ws-code-title))::before {
|
|
102
|
+
content: none;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.vp-doc div[class*='language-'] > span.lang,
|
|
106
|
+
.vp-doc div[class*='language-'] > .ws-code-title {
|
|
107
|
+
position: absolute;
|
|
108
|
+
top: 0;
|
|
109
|
+
z-index: 2;
|
|
110
|
+
color: var(--ws-code-text-secondary);
|
|
111
|
+
font: var(--ws-text-caption);
|
|
112
|
+
line-height: var(--ws-caption);
|
|
113
|
+
transition: opacity var(--ws-motion-duration-fast);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.vp-doc div[class*='language-'] > span.lang {
|
|
117
|
+
right: var(--ws-space-16);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.vp-doc div[class*='language-'] > .ws-code-title {
|
|
121
|
+
left: var(--ws-space-16);
|
|
122
|
+
max-width: calc(100% - 6rem);
|
|
123
|
+
overflow: hidden;
|
|
124
|
+
text-overflow: ellipsis;
|
|
125
|
+
white-space: nowrap;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.vp-doc div[class*='language-'] > button.copy {
|
|
129
|
+
top: 0.375rem;
|
|
130
|
+
right: var(--ws-space-8);
|
|
131
|
+
width: 1.5rem;
|
|
132
|
+
height: 1.5rem;
|
|
133
|
+
border-radius: var(--ws-radius-sm);
|
|
134
|
+
background-size: 0.875rem;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.vp-doc div[class*='language-'] > button.copy.copied::before,
|
|
138
|
+
.vp-doc div[class*='language-'] > button.copy:hover.copied::before {
|
|
139
|
+
width: auto;
|
|
140
|
+
height: 1.5rem;
|
|
141
|
+
border-radius: var(--ws-radius-sm) 0 0 var(--ws-radius-sm);
|
|
142
|
+
padding: 0 var(--ws-space-8);
|
|
143
|
+
font: var(--ws-text-caption);
|
|
144
|
+
line-height: 1.5rem;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.vp-doc div[class*='language-'] pre {
|
|
148
|
+
padding: var(--ws-space-16) 0;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.vp-doc div[class*='language-'] code {
|
|
152
|
+
padding: 0 var(--ws-space-16);
|
|
153
|
+
font: var(--ws-text-code);
|
|
154
|
+
font-variant-ligatures: none;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.vp-doc div[class*='language-'].line-numbers-mode .line-numbers-wrapper {
|
|
158
|
+
top: var(--ws-caption);
|
|
159
|
+
padding-top: var(--ws-space-16);
|
|
160
|
+
border-right-color: var(--ws-code-border);
|
|
161
|
+
font: var(--ws-text-code);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.vp-doc div[class*='language-'] ::selection {
|
|
165
|
+
background: var(--ws-code-selection);
|
|
166
|
+
color: var(--ws-code-text);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/* a group of code blocks shares one frame, and its tabs are the caption */
|
|
170
|
+
.vp-doc .vp-code-group {
|
|
171
|
+
margin-top: var(--ws-space-16);
|
|
172
|
+
overflow: hidden;
|
|
173
|
+
border: var(--ws-border-width-thin) solid var(--ws-code-border);
|
|
174
|
+
border-radius: var(--ws-radius-lg);
|
|
175
|
+
color-scheme: dark;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.vp-doc .vp-code-group .tabs {
|
|
179
|
+
margin: 0;
|
|
180
|
+
padding: 0 var(--ws-space-8);
|
|
181
|
+
border-radius: 0;
|
|
182
|
+
box-shadow: inset 0 -1px var(--ws-code-border);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.vp-doc .vp-code-group .tabs label {
|
|
186
|
+
padding: 0 var(--ws-space-10);
|
|
187
|
+
font: var(--ws-text-caption);
|
|
188
|
+
line-height: 2.25rem;
|
|
189
|
+
transition: none;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.vp-doc .vp-code-group .tabs label::after {
|
|
193
|
+
right: var(--ws-space-10);
|
|
194
|
+
left: var(--ws-space-10);
|
|
195
|
+
height: var(--ws-border-width-medium);
|
|
196
|
+
border-radius: 0;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.vp-doc .vp-code-group div[class*='language-'] {
|
|
200
|
+
margin: 0;
|
|
201
|
+
padding-top: 0;
|
|
202
|
+
border: 0;
|
|
203
|
+
border-radius: 0;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.vp-doc .vp-code-group div[class*='language-']::before,
|
|
207
|
+
.vp-doc .vp-code-group div[class*='language-'] > .ws-code-title {
|
|
208
|
+
display: none;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.vp-doc .vp-code-group div[class*='language-'] > span.lang {
|
|
212
|
+
top: var(--ws-space-4);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.vp-doc .vp-code-group div[class*='language-'] > button.copy {
|
|
216
|
+
top: var(--ws-space-8);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/* custom blocks: a bar in the status color, a label with an icon, then text */
|
|
220
|
+
.vp-doc .custom-block {
|
|
221
|
+
--ws-callout-tone: var(--ws-color-note);
|
|
222
|
+
--ws-callout-label: var(--ws-color-note-text);
|
|
223
|
+
--ws-callout-icon: var(--ws-icon-note);
|
|
224
|
+
|
|
225
|
+
margin: var(--ws-space-20) 0 0;
|
|
226
|
+
padding: var(--ws-space-14) var(--ws-space-16) var(--ws-space-16);
|
|
227
|
+
border: 0;
|
|
228
|
+
border-left: var(--ws-border-width-thick) solid var(--ws-callout-tone);
|
|
229
|
+
border-radius: 0 var(--ws-radius-lg) var(--ws-radius-lg) 0;
|
|
230
|
+
font-size: var(--ws-font-size-16);
|
|
231
|
+
line-height: var(--ws-text-body-line-height);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.vp-doc .custom-block.tip {
|
|
235
|
+
--ws-callout-tone: var(--ws-color-tip);
|
|
236
|
+
--ws-callout-label: var(--ws-color-tip-text);
|
|
237
|
+
--ws-callout-icon: var(--ws-icon-tip);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.vp-doc .custom-block.warning {
|
|
241
|
+
--ws-callout-tone: var(--ws-color-warning);
|
|
242
|
+
--ws-callout-label: var(--ws-color-warning-text);
|
|
243
|
+
--ws-callout-icon: var(--ws-icon-warning);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.vp-doc .custom-block:is(.danger, .caution) {
|
|
247
|
+
--ws-callout-tone: var(--ws-color-danger);
|
|
248
|
+
--ws-callout-label: var(--ws-color-danger-text);
|
|
249
|
+
--ws-callout-icon: var(--ws-icon-danger);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.vp-doc .custom-block.details {
|
|
253
|
+
border-left-color: var(--ws-color-border-strong);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.vp-doc .custom-block .custom-block-title {
|
|
257
|
+
display: flex;
|
|
258
|
+
align-items: center;
|
|
259
|
+
gap: var(--ws-space-8);
|
|
260
|
+
margin: 0;
|
|
261
|
+
color: var(--ws-callout-label);
|
|
262
|
+
font: var(--ws-text-overline);
|
|
263
|
+
letter-spacing: var(--ws-text-overline-letter-spacing);
|
|
264
|
+
text-transform: uppercase;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.vp-doc .custom-block .custom-block-title::before {
|
|
268
|
+
flex: none;
|
|
269
|
+
width: 1rem;
|
|
270
|
+
height: 1rem;
|
|
271
|
+
background: currentcolor;
|
|
272
|
+
content: '';
|
|
273
|
+
mask: var(--ws-callout-icon) center / contain no-repeat;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.vp-doc .custom-block.details summary {
|
|
277
|
+
margin: 0;
|
|
278
|
+
color: var(--ws-color-text);
|
|
279
|
+
font: var(--ws-text-label);
|
|
280
|
+
font-weight: var(--ws-font-weight-bold);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.vp-doc .custom-block p {
|
|
284
|
+
margin: var(--ws-space-6) 0 0;
|
|
285
|
+
font-size: inherit;
|
|
286
|
+
line-height: inherit;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.vp-doc .custom-block a,
|
|
290
|
+
.vp-doc .custom-block a:hover {
|
|
291
|
+
color: var(--ws-color-interactive);
|
|
292
|
+
font-weight: inherit;
|
|
293
|
+
opacity: 1;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.vp-doc .custom-block code {
|
|
297
|
+
font-size: 0.8125em;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/* inline code only: a code block in a callout keeps the colors of a code block */
|
|
301
|
+
.vp-doc .custom-block :not(pre) > code {
|
|
302
|
+
color: var(--ws-color-text);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.vp-doc .custom-block a > code,
|
|
306
|
+
.vp-doc .custom-block a:hover > code {
|
|
307
|
+
color: inherit;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.vp-doc .custom-block div[class*='language-'] {
|
|
311
|
+
margin: var(--ws-space-10) 0 0;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/* a badge next to a heading */
|
|
315
|
+
.vp-doc .VPBadge {
|
|
316
|
+
border-radius: var(--ws-radius-sm);
|
|
317
|
+
font-family: var(--ws-font-family-mono);
|
|
318
|
+
font-weight: var(--ws-font-weight-medium);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/* footer of a page: edit link, last change, previous and next */
|
|
322
|
+
.VPDoc .VPDocFooter {
|
|
323
|
+
margin-top: var(--ws-space-56);
|
|
324
|
+
font-family: var(--ws-font-family-mono);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.VPDoc .VPDocFooter .edit-info {
|
|
328
|
+
padding-bottom: var(--ws-space-16);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.VPDoc .VPDocFooter .edit-link-button,
|
|
332
|
+
.VPDoc .VPDocFooter .last-updated-text {
|
|
333
|
+
color: var(--ws-color-text-secondary);
|
|
334
|
+
font: var(--ws-text-caption);
|
|
335
|
+
line-height: 2rem;
|
|
336
|
+
transition: none;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.VPDoc .VPDocFooter .edit-link-button {
|
|
340
|
+
color: var(--ws-color-interactive);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.VPDoc .VPDocFooter .prev-next {
|
|
344
|
+
gap: var(--ws-space-16);
|
|
345
|
+
border-top: 0;
|
|
346
|
+
padding-top: 0;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.VPDoc .VPDocFooter .pager-link {
|
|
350
|
+
padding: var(--ws-space-12) var(--ws-space-16);
|
|
351
|
+
border: var(--ws-border-width-thin) solid var(--ws-color-border);
|
|
352
|
+
border-radius: var(--ws-radius-lg);
|
|
353
|
+
transition: none;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.VPDoc .VPDocFooter .pager-link:hover {
|
|
357
|
+
border-color: var(--ws-color-field-border);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.VPDoc .VPDocFooter .pager-link .desc {
|
|
361
|
+
color: var(--ws-color-text-secondary);
|
|
362
|
+
font: var(--ws-text-overline);
|
|
363
|
+
font-weight: var(--ws-font-weight-medium);
|
|
364
|
+
letter-spacing: var(--ws-text-overline-letter-spacing);
|
|
365
|
+
line-height: 1.25rem;
|
|
366
|
+
text-transform: uppercase;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.VPDoc .VPDocFooter .pager-link .title {
|
|
370
|
+
color: var(--ws-color-text);
|
|
371
|
+
font: var(--ws-text-label);
|
|
372
|
+
font-size: var(--ws-font-size-15);
|
|
373
|
+
font-weight: var(--ws-font-weight-bold);
|
|
374
|
+
transition: none;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
@media (width >= 60rem) {
|
|
378
|
+
.VPDoc.VPDoc {
|
|
379
|
+
padding: var(--ws-space-40) var(--ws-space-32) 0;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.VPDoc .aside-container {
|
|
383
|
+
padding-bottom: var(--ws-size-status-line);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/* The home layout of the default theme, for a docs site that opens with a hero. */
|
|
2
|
+
.VPHome .VPHero .name,
|
|
3
|
+
.VPHome .VPHero .text {
|
|
4
|
+
font-family: var(--ws-font-family-mono);
|
|
5
|
+
font-weight: var(--ws-font-weight-extrabold);
|
|
6
|
+
letter-spacing: -0.03em;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.VPHome .VPHero .name .clip {
|
|
10
|
+
color: var(--ws-color-text);
|
|
11
|
+
-webkit-text-fill-color: currentcolor;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.VPHome .VPHero .tagline {
|
|
15
|
+
color: var(--ws-color-text-secondary);
|
|
16
|
+
font-family: var(--ws-font-family-sans);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* buttons are not pills: the default theme rounds them by size */
|
|
20
|
+
.VPHome .VPButton:is(.medium, .big),
|
|
21
|
+
.vp-doc .VPButton:is(.medium, .big) {
|
|
22
|
+
border-radius: var(--ws-radius-md);
|
|
23
|
+
font-family: var(--ws-font-family-mono);
|
|
24
|
+
font-weight: var(--ws-font-weight-bold);
|
|
25
|
+
transition: none;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.VPHome .VPFeature {
|
|
29
|
+
border: var(--ws-border-width-thin) solid var(--ws-color-border);
|
|
30
|
+
border-radius: var(--ws-radius-lg);
|
|
31
|
+
background: var(--ws-color-surface);
|
|
32
|
+
transition: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.VPHome .VPFeature .title {
|
|
36
|
+
font: var(--ws-text-h4);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.VPHome .VPFeature .details {
|
|
40
|
+
color: var(--ws-color-text-secondary);
|
|
41
|
+
font: var(--ws-text-body-sm);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.VPHome .VPFeature .icon {
|
|
45
|
+
border-radius: var(--ws-radius-md);
|
|
46
|
+
background: var(--ws-color-raised);
|
|
47
|
+
}
|