markupress 0.0.2 → 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/README.md +244 -10
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/content.d.ts +42 -1
- package/dist/content.d.ts.map +1 -1
- package/dist/content.js +276 -23
- package/dist/content.js.map +1 -1
- package/dist/controllers/code.d.ts +7 -0
- package/dist/controllers/code.d.ts.map +1 -0
- package/dist/controllers/code.js +31 -0
- package/dist/controllers/code.js.map +1 -0
- package/dist/controllers/outline.d.ts +8 -0
- package/dist/controllers/outline.d.ts.map +1 -0
- package/dist/controllers/outline.js +45 -0
- package/dist/controllers/outline.js.map +1 -0
- package/dist/controllers/shell.d.ts +6 -1
- package/dist/controllers/shell.d.ts.map +1 -1
- package/dist/controllers/shell.js +19 -24
- package/dist/controllers/shell.js.map +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/markdown.d.ts +24 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/markdown.js +54 -0
- package/dist/markdown.js.map +1 -0
- package/dist/navigation.d.ts +51 -0
- package/dist/navigation.d.ts.map +1 -0
- package/dist/navigation.js +71 -0
- package/dist/navigation.js.map +1 -0
- package/dist/site.d.ts +47 -10
- package/dist/site.d.ts.map +1 -1
- package/dist/site.js +152 -262
- package/dist/site.js.map +1 -1
- package/dist/theme.d.ts +2 -1
- package/dist/theme.d.ts.map +1 -1
- package/dist/theme.js +4 -34
- package/dist/theme.js.map +1 -1
- package/dist/versions.d.ts.map +1 -1
- package/dist/versions.js +10 -5
- package/dist/versions.js.map +1 -1
- package/package.json +21 -12
- package/styles/base.css +1 -21
- package/styles/prose.css +14 -0
- package/theme/outline.html +11 -0
- package/theme/shell.html +66 -0
- package/theme/theme.css +52 -0
package/dist/versions.js
CHANGED
|
@@ -2,7 +2,7 @@ import { cp, mkdir, readFile, realpath, rename, rm, writeFile } from 'node:fs/pr
|
|
|
2
2
|
import { resolve, join, relative, isAbsolute, dirname } from 'node:path';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import { buildApplication, createApplication } from '@nextwebwg/htmlkit';
|
|
5
|
-
import {
|
|
5
|
+
import { siteOptions } from './site.js';
|
|
6
6
|
import { stylesheet } from './styles.js';
|
|
7
7
|
/** URLs are projected from logical identity; renaming a route never changes the switch target. */
|
|
8
8
|
export function versionLinks(documents, versions, id, selected, base) {
|
|
@@ -59,11 +59,12 @@ export async function snapshotVersion(id, options = {}) {
|
|
|
59
59
|
}
|
|
60
60
|
// Let HTMLKit/Vite identify the authored HTML, module, stylesheet and asset closure.
|
|
61
61
|
// Mirroring project-relative paths keeps imports valid without rewriting source code.
|
|
62
|
-
const
|
|
62
|
+
const site = siteOptions({ ...options, versions: [{ id: 'current', directory: relation }], defaultVersion: 'current' });
|
|
63
63
|
const validation = join(destination, '.validation');
|
|
64
|
-
const built = await buildApplication({ ...
|
|
65
|
-
const
|
|
66
|
-
|
|
64
|
+
const built = await buildApplication({ ...site, outDir: validation });
|
|
65
|
+
const application = await createApplication(site);
|
|
66
|
+
// Files that Markdown references, which HTMLKit serves, belong to the snapshot too.
|
|
67
|
+
const inputs = new Set([...built.browserInputs, ...application.files.values()]);
|
|
67
68
|
try {
|
|
68
69
|
for (const pathname of await application.entries()) {
|
|
69
70
|
for (const component of (await application.render(pathname)).components) {
|
|
@@ -72,6 +73,10 @@ export async function snapshotVersion(id, options = {}) {
|
|
|
72
73
|
inputs.add(file.startsWith('file:') ? fileURLToPath(file) : file);
|
|
73
74
|
for (const dependency of stylesheet(component.definition.css, fileURLToPath(file), false).files)
|
|
74
75
|
inputs.add(dependency);
|
|
76
|
+
// HTMLKit delivers a component's imported stylesheets apart from its local CSS, nested imports included.
|
|
77
|
+
for (const sheet of component.definition.stylesheets ?? [])
|
|
78
|
+
if (sheet.url.startsWith('file:'))
|
|
79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AAC,CAAC;QACnE,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACnD,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markupress",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Versioned Markdown documentation built on HTMLKit and native declarative components.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -11,11 +11,15 @@
|
|
|
11
11
|
"import": "./dist/index.js"
|
|
12
12
|
},
|
|
13
13
|
"./controllers/shell.js": "./dist/controllers/shell.js",
|
|
14
|
-
"./
|
|
14
|
+
"./controllers/code.js": "./dist/controllers/code.js",
|
|
15
|
+
"./controllers/outline.js": "./dist/controllers/outline.js",
|
|
16
|
+
"./styles/base.css": "./styles/base.css",
|
|
17
|
+
"./styles/prose.css": "./styles/prose.css"
|
|
15
18
|
},
|
|
16
19
|
"files": [
|
|
17
20
|
"dist",
|
|
18
|
-
"styles"
|
|
21
|
+
"styles",
|
|
22
|
+
"theme"
|
|
19
23
|
],
|
|
20
24
|
"engines": {
|
|
21
25
|
"node": ">=22.22.2 <23 || >=24.15 <25"
|
|
@@ -36,11 +40,13 @@
|
|
|
36
40
|
},
|
|
37
41
|
"devDependencies": {
|
|
38
42
|
"@types/node": "22.20.1",
|
|
39
|
-
"oxlint": "1.
|
|
43
|
+
"oxlint": "1.88.0",
|
|
40
44
|
"typescript": "7.0.2",
|
|
41
|
-
"vitest": "5.0.
|
|
42
|
-
"playwright": "1.
|
|
43
|
-
"@axe-core/playwright": "4.13.0"
|
|
45
|
+
"vitest": "5.0.4",
|
|
46
|
+
"playwright": "1.64.0",
|
|
47
|
+
"@axe-core/playwright": "4.13.0",
|
|
48
|
+
"@nextwebwg/html-next": "1.0.0-alpha.51",
|
|
49
|
+
"@threadlabs/looma": "0.28.5"
|
|
44
50
|
},
|
|
45
51
|
"publishConfig": { "access": "public" },
|
|
46
52
|
"repository": {
|
|
@@ -52,14 +58,17 @@
|
|
|
52
58
|
"url": "https://github.com/threadlabs-studio/markupress/issues"
|
|
53
59
|
},
|
|
54
60
|
"dependencies": {
|
|
55
|
-
"@nextwebwg/htmlkit": "1.0.0-alpha.
|
|
56
|
-
"marked": "18.1.
|
|
61
|
+
"@nextwebwg/htmlkit": "1.0.0-alpha.51",
|
|
62
|
+
"marked": "18.1.1",
|
|
57
63
|
"parse5": "8.0.1",
|
|
58
64
|
"yaml": "2.9.1",
|
|
59
|
-
"
|
|
60
|
-
"postcss": "8.5.29",
|
|
65
|
+
"postcss": "8.5.30",
|
|
61
66
|
"postcss-value-parser": "4.2.0",
|
|
62
|
-
"
|
|
67
|
+
"shiki": "4.5.0"
|
|
68
|
+
},
|
|
69
|
+
"peerDependencies": {
|
|
70
|
+
"@nextwebwg/html-next": "1.0.0-alpha.51",
|
|
71
|
+
"@threadlabs/looma": "^0.28.5"
|
|
63
72
|
},
|
|
64
73
|
"bin": {
|
|
65
74
|
"markupress": "./dist/cli.js"
|
package/styles/base.css
CHANGED
|
@@ -1,24 +1,4 @@
|
|
|
1
|
-
/* Page-wide defaults
|
|
1
|
+
/* Page-wide defaults, delivered through HTMLKit's css option; components keep their own styles. */
|
|
2
2
|
html { background: var(--ui-surface); }
|
|
3
3
|
body { margin: 0; }
|
|
4
4
|
*, *::before, *::after { box-sizing: border-box; }
|
|
5
|
-
/* Documentation typography spans the projected page's own component region. */
|
|
6
|
-
.markupress-prose a { color: var(--ui-accent); text-underline-offset: .2em; }
|
|
7
|
-
.markupress-prose h1 { font-size: clamp(1.8rem, 5vw, 2.7rem); line-height: 1.2; }
|
|
8
|
-
.markupress-prose h2, .markupress-prose h3 { margin-top: 2rem; scroll-margin-top: 2rem; }
|
|
9
|
-
.markupress-prose h1 a, .markupress-prose h2 a, .markupress-prose h3 a { color: inherit; text-decoration: none; }
|
|
10
|
-
.markupress-prose pre { overflow: auto; max-width: 100%; padding: 1rem; background: var(--ui-surface-sunken); border-radius: .5rem; }
|
|
11
|
-
.markupress-prose code { font-size: .9em; }
|
|
12
|
-
.markupress-prose img, .markupress-prose svg { max-width: 100%; }
|
|
13
|
-
.markupress-prose table { border-collapse: collapse; display: block; max-width: 100%; overflow: auto; }
|
|
14
|
-
.markupress-prose th, .markupress-prose td { border: 1px solid var(--ui-border, #8885); padding: .4rem .75rem; }
|
|
15
|
-
.markupress-prose :focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 3px; }
|
|
16
|
-
/* HTMLKit provides native navigation without presentation; this theme owns its appearance. */
|
|
17
|
-
.site [data-component~="htmlkit-navigation"] ul { margin: 0; padding: 0; list-style: none; }
|
|
18
|
-
.site [data-component~="htmlkit-navigation"] li { margin: .25rem 0; }
|
|
19
|
-
.site [data-component~="htmlkit-navigation"] a { display: block; color: var(--ui-text); padding: .3rem .5rem; border-radius: .25rem; text-decoration: none; }
|
|
20
|
-
.site [data-component~="htmlkit-navigation"] a:hover { background: var(--ui-surface-sunken); }
|
|
21
|
-
.site [data-component~="htmlkit-navigation"] a[aria-current="page"] { color: var(--ui-accent); font-weight: 600; background: var(--ui-surface-sunken); }
|
|
22
|
-
.site [data-component~="htmlkit-navigation"] [data-depth="2"] { padding-left: .75rem; }
|
|
23
|
-
.site [data-component~="htmlkit-navigation"] [data-depth="3"] { padding-left: 1.5rem; }
|
|
24
|
-
.site [data-component~="htmlkit-navigation"] :focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; }
|
package/styles/prose.css
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* Documentation typography. Each Markdown page component imports this, so its selectors match inside
|
|
2
|
+
that page only and stop at any component the page embeds. The page root itself is .markupress-prose. */
|
|
3
|
+
a { color: var(--ui-accent); text-underline-offset: .2em; }
|
|
4
|
+
h1 { font-size: clamp(1.8rem, 5vw, 2.7rem); line-height: 1.2; }
|
|
5
|
+
h2, h3 { margin-top: 2rem; scroll-margin-top: 2rem; }
|
|
6
|
+
h1 a, h2 a, h3 a { color: inherit; text-decoration: none; }
|
|
7
|
+
pre { overflow: auto; max-width: 100%; padding: 1rem; background: var(--ui-surface-sunken); border-radius: .5rem; }
|
|
8
|
+
figure.code { margin: 1rem 0; }
|
|
9
|
+
figure.code figcaption { margin-bottom: .25rem; font: .85rem ui-monospace, monospace; color: var(--ui-text-muted, inherit); }
|
|
10
|
+
code { font-size: .9em; }
|
|
11
|
+
img, svg { max-width: 100%; }
|
|
12
|
+
table { border-collapse: collapse; display: block; max-width: 100%; overflow: auto; }
|
|
13
|
+
th, td { border: 1px solid var(--ui-border, #8885); padding: .4rem .75rem; }
|
|
14
|
+
:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 3px; }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<template component="markupress-outline" controller="../dist/controllers/outline.js">
|
|
2
|
+
<defs><prop name="items" type="list(object({ id: string, href: string, label: string, depth: number }))" required>The page's headings, in order</prop></defs>
|
|
3
|
+
<nav aria-labelledby="markupress-outline-title"><strong id="markupress-outline-title">On this page</strong><ul><li $each="item of $items" from:data-depth="$item.depth"><a from:href="$item.href">{$item.label}</a></li></ul></nav>
|
|
4
|
+
<style>
|
|
5
|
+
nav { font-size: .875rem; } strong { display: block; margin-bottom: .5rem; }
|
|
6
|
+
ul { margin: 0; padding: 0; list-style: none; border-inline-start: 1px solid var(--ui-border, #8885); }
|
|
7
|
+
li { margin: 0; } li[data-depth="3"] a { padding-inline-start: 1.75rem; }
|
|
8
|
+
a { display: block; padding: .2rem 0 .2rem 1rem; margin-inline-start: -1px; border-inline-start: 2px solid transparent; color: var(--ui-text-muted, inherit); text-decoration: none; }
|
|
9
|
+
a:hover { color: var(--ui-text); } a[aria-current="location"] { border-color: var(--ui-accent); color: var(--ui-accent); }
|
|
10
|
+
:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; }
|
|
11
|
+
</style></template>
|
package/theme/shell.html
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<link rel="component" href="@threadlabs/looma/components/ui-button/ui-button.html">
|
|
2
|
+
<link rel="component" href="@threadlabs/looma/components/ui-badge/ui-badge.html">
|
|
3
|
+
<link rel="component" href="./outline.html">
|
|
4
|
+
<template component="markupress-shell" controller="../dist/controllers/shell.js">
|
|
5
|
+
<title>{$title}</title><link $if="$favicon" rel="icon" from:href="$favicon"><defs>
|
|
6
|
+
<prop name="title" type="string" required>Site title</prop>
|
|
7
|
+
<prop name="home" type="string" required>Home URL</prop>
|
|
8
|
+
<prop name="logo" type="object({ light: string, dark: string })" nullable>Logo images for the light and dark themes</prop>
|
|
9
|
+
<prop name="favicon" type="string" nullable>Site icon URL</prop>
|
|
10
|
+
<prop name="badge" type="string" default="">Badge beside the title</prop>
|
|
11
|
+
<prop name="nav" type="list(object({ label: string, href: string, current: string, items: list(object({ label: string, href: string, current: string, ... })), ... }))" required>Top navigation: links, and dropdowns with items</prop>
|
|
12
|
+
<prop name="social" type="list(object({ label: string, href: string, icon: string }))" required>Social links</prop>
|
|
13
|
+
<prop name="sidebar" type="list(object({ label: string, current: string, depth: number, href?: string, open?: boolean, children?: list(object({ label: string, ... })), ... }))" required>The section's sidebar: pages and links, and folders and groups with children, as <hk-nav> renders them</prop>
|
|
14
|
+
<prop name="outline" type="list(object({ id: string, href: string, label: string, depth: number }))" required>The page's headings</prop>
|
|
15
|
+
<prop name="footer" type="object({ columns: list(object({ title: string, items: list(object({ label: string, href: string, current: string })) })), copyright: string })" required>Footer link columns and copyright</prop>
|
|
16
|
+
<prop name="versions" type="list(object({ href: string, label: string, current: string, note: string }))" required>Documentation versions</prop>
|
|
17
|
+
<prop name="crumbs" type="list(object({ href: string, label: string, current: string, depth: number, pageName: string, ... }))" required>Trail from the version home to this page</prop>
|
|
18
|
+
<prop name="previous" type="object({ href: string, label: string, current: string, depth: number, pageName: string, ... })" nullable>The page before this one</prop>
|
|
19
|
+
<prop name="next" type="object({ href: string, label: string, current: string, depth: number, pageName: string, ... })" nullable>The page after this one</prop>
|
|
20
|
+
<state name="dark" type="boolean" value="false"></state></defs>
|
|
21
|
+
<div class="site"><a class="skip" href="#documentation-content">Skip to content</a>
|
|
22
|
+
<header>
|
|
23
|
+
<span class="menu"><ui-button variant="ghost" tone="neutral" popovertarget="documentation-navigation">Navigation</ui-button></span>
|
|
24
|
+
<a class="brand" from:href="$home"><template $if="$logo"><img class="logo logo-light" from:src="$logo.light" alt=""><img class="logo logo-dark" from:src="$logo.dark" alt=""></template>{$title}</a>
|
|
25
|
+
<ui-badge $if="$badge" tone="accent">{$badge}</ui-badge>
|
|
26
|
+
<nav class="top" $if="$nav.length" aria-label="Main"><ul><li $each="item of $nav">
|
|
27
|
+
<template $match><a $when="$item.href" from:href="$item.href" from:aria-current="$item.current">{$item.label}</a>
|
|
28
|
+
<details $else name="markupress-nav"><summary from:data-current="$item.current">{$item.label}</summary><ul><li $each="link of $item.items"><a from:href="$link.href" from:aria-current="$link.current">{$link.label}</a></li></ul></details></template>
|
|
29
|
+
</li></ul></nav>
|
|
30
|
+
<div class="actions"><ul class="social" $if="$social.length"><li $each="link of $social"><a from:href="$link.href"><template $match><img $when="$link.icon" from:src="$link.icon" from:alt="$link.label"><template $else>{$link.label}</template></template></a></li></ul>
|
|
31
|
+
<ui-button variant="ghost" tone="neutral" data-action="theme" from:aria-pressed="$dark">Dark theme</ui-button></div></header>
|
|
32
|
+
<div class="columns"><aside id="documentation-navigation" popover>
|
|
33
|
+
<hk-nav from:items="$sidebar" label="Documentation"></hk-nav>
|
|
34
|
+
<nav class="versions" aria-label="Documentation versions"><strong>Versions</strong><ul><li $each="version of $versions"><a from:href="$version.href" from:aria-current="$version.current">{$version.label}</a><small $if="$version.note">{$version.note}</small></li></ul></nav>
|
|
35
|
+
</aside><main id="documentation-content" tabindex="-1"><hk-breadcrumbs from:items="$crumbs"></hk-breadcrumbs><slot name="page"></slot><hk-pager from:previous="$previous" from:next="$next"></hk-pager></main>
|
|
36
|
+
<aside class="outline" $if="$outline.length"><markupress-outline from:items="$outline"></markupress-outline></aside></div>
|
|
37
|
+
<footer $if="$footer.columns.length or $footer.copyright"><div class="footer-columns" $if="$footer.columns.length"><div $each="column of $footer.columns"><strong>{$column.title}</strong><ul><li $each="link of $column.items"><a from:href="$link.href" from:aria-current="$link.current">{$link.label}</a></li></ul></div></div>
|
|
38
|
+
<p $if="$footer.copyright">{$footer.copyright}</p></footer></div>
|
|
39
|
+
<style>
|
|
40
|
+
:host { display: block; background: var(--ui-surface); color: var(--ui-text); font: 1rem/1.7 system-ui, sans-serif; min-height: 100vh; }
|
|
41
|
+
.site { display: flex; flex-direction: column; min-height: 100vh; }
|
|
42
|
+
header { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; border-bottom: 1px solid var(--ui-border, #8885); padding: .75rem max(1rem, calc((100vw - 90rem) / 2)); background: var(--ui-surface); }
|
|
43
|
+
.brand { display: flex; align-items: center; gap: .5rem; color: inherit; font-size: 1.15rem; font-weight: 700; text-decoration: none; } .logo { block-size: 2rem; inline-size: auto; }
|
|
44
|
+
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-inline-start: auto; }
|
|
45
|
+
header ul { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin: 0; padding: 0; list-style: none; }
|
|
46
|
+
header a { color: inherit; text-decoration: none; } header a:hover, header a[aria-current="page"], header a[aria-current="true"], summary[data-current="true"] { color: var(--ui-accent); }
|
|
47
|
+
.social img { display: block; block-size: 1.25rem; inline-size: auto; }
|
|
48
|
+
.top details { position: relative; } .top summary { cursor: pointer; }
|
|
49
|
+
.top details ul { position: absolute; inset-block-start: calc(100% + .5rem); inset-inline-start: 0; display: grid; gap: .25rem; min-inline-size: 12rem; padding: .5rem 1rem; border: 1px solid var(--ui-border, #8885); border-radius: var(--ui-radius-md, .5rem); background: var(--ui-surface); }
|
|
50
|
+
.columns { display: flex; gap: 3rem; flex: 1; inline-size: 100%; max-inline-size: 90rem; margin: auto; padding: 2rem 1.5rem; }
|
|
51
|
+
#documentation-navigation { flex: 0 0 15rem; } main { min-width: 0; flex: 1; max-width: 65ch; } .outline { flex: 0 0 13rem; }
|
|
52
|
+
/* Wide screens show the sidebar in the page; narrow ones open it as a native popover, which needs no script. */
|
|
53
|
+
@media (min-width: 769px) { #documentation-navigation { display: block; position: static; inset: auto; margin: 0; padding: 0; border: 0; background: none; color: inherit; overflow: visible; }
|
|
54
|
+
#documentation-navigation, .outline { position: sticky; top: 5rem; align-self: flex-start; max-block-size: calc(100vh - 6rem); overflow: auto; } .menu { display: none; } }
|
|
55
|
+
@media (max-width: 1199px) { .outline { display: none; } }
|
|
56
|
+
@media (max-width: 768px) { header { position: static; } .columns { display: block; padding: 1rem; }
|
|
57
|
+
#documentation-navigation { inset: 0 auto 0 0; block-size: 100%; max-block-size: none; inline-size: min(20rem, 85vw); margin: 0; padding: 1rem; border: 0; border-inline-end: 1px solid var(--ui-border, #8885); background: var(--ui-surface); color: var(--ui-text); }
|
|
58
|
+
#documentation-navigation::backdrop { background: rgb(0 0 0 / .4); } }
|
|
59
|
+
.versions ul { margin: 0; padding: 0; list-style: none; } .versions li { margin: .4rem 0; } .versions { margin-top: 2rem; }
|
|
60
|
+
a { color: var(--ui-accent); text-underline-offset: .2em; } a[aria-current="page"] { font-weight: 700; } small { display: block; color: var(--ui-text-muted, inherit); line-height: 1.4; } :focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 3px; }
|
|
61
|
+
.skip { position: absolute; top: .5rem; left: 1rem; transform: translateY(-200%); padding: .5rem 1rem; background: var(--ui-surface); z-index: 3; } .skip:focus { transform: none; }
|
|
62
|
+
footer { border-top: 1px solid var(--ui-border, #8885); padding: 2rem max(1.5rem, calc((100vw - 90rem) / 2)); color: var(--ui-text-muted, inherit); font-size: .9rem; }
|
|
63
|
+
.footer-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1.5rem; } footer ul { margin: .5rem 0 0; padding: 0; list-style: none; } footer li { margin: .25rem 0; } footer strong { color: var(--ui-text); }
|
|
64
|
+
footer p { margin: 1.5rem 0 0; }
|
|
65
|
+
@media (max-width: 640px) { header { padding-inline: 1rem; } }
|
|
66
|
+
</style></template>
|
package/theme/theme.css
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/* Global, so it reaches HTMLKit's built-in navigation, breadcrumbs and pager inside the shell; the shell's own <style> is scoped and stops at them. */
|
|
2
|
+
[data-component~="markupress-shell"] :is([data-component="hk-breadcrumbs"], [data-component="hk-pager"]) a {
|
|
3
|
+
color: var(--ui-accent); text-underline-offset: .2em;
|
|
4
|
+
}
|
|
5
|
+
[data-component~="markupress-shell"] [data-component="hk-breadcrumbs"] a[aria-current="page"] { font-weight: 700; }
|
|
6
|
+
[data-component~="markupress-shell"] [data-component="hk-breadcrumbs"] ol { display: flex; flex-wrap: wrap; gap: .25rem .5rem; margin: 0 0 1.5rem; padding: 0; list-style: none; font-size: .875rem; }
|
|
7
|
+
[data-component~="markupress-shell"] [data-component="hk-breadcrumbs"] li + li::before { content: "/"; margin-inline-end: .5rem; color: var(--ui-text-muted, inherit); }
|
|
8
|
+
[data-component~="markupress-shell"] [data-component="hk-pager"] { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--ui-border, #8885); }
|
|
9
|
+
[data-component~="markupress-shell"] [data-component="hk-pager"] a { display: grid; }
|
|
10
|
+
[data-component~="markupress-shell"] [data-component="hk-pager"] a[rel="next"] { margin-inline-start: auto; text-align: end; }
|
|
11
|
+
[data-component~="markupress-shell"] [data-component="hk-pager"] small { color: var(--ui-text-muted, inherit); }
|
|
12
|
+
/* The sidebar is HTMLKit's <hk-nav>: nested lists, with each folder and group in a native <details>. */
|
|
13
|
+
[data-component~="markupress-shell"] [data-component="hk-nav"] ul { margin: 0; padding: 0; list-style: none; }
|
|
14
|
+
[data-component~="markupress-shell"] [data-component="hk-nav"] li { margin: .4rem 0; }
|
|
15
|
+
[data-component~="markupress-shell"] [data-component="hk-nav"] details ul { padding-inline-start: .75rem; }
|
|
16
|
+
[data-component~="markupress-shell"] [data-component="hk-nav"] summary { cursor: pointer; font-weight: 600; }
|
|
17
|
+
[data-component~="markupress-shell"] [data-component="hk-nav"] a { color: var(--ui-accent); text-underline-offset: .2em; }
|
|
18
|
+
[data-component~="markupress-shell"] [data-component="hk-nav"] a[aria-current="page"] { font-weight: 700; }
|
|
19
|
+
/* Shared blocks. Markdown inside a callout or tabs is projected into a Looma component, where the page's scoped
|
|
20
|
+
prose styles never reach (HTML Next styling: a page's rules stop at every nested component), so these global
|
|
21
|
+
rules space the blocks and repeat the prose code styles inside them. Details is native and needs no script. */
|
|
22
|
+
.markupress-prose :is([data-component~="ui-callout"], [data-component~="ui-tabs"], details) { margin-block: 1rem; }
|
|
23
|
+
.markupress-prose details { padding: .5rem 1rem; border: 1px solid var(--ui-border, #8885); border-radius: var(--ui-radius-md, .5rem); }
|
|
24
|
+
.markupress-prose summary { cursor: pointer; font-weight: 600; }
|
|
25
|
+
.markupress-prose [data-component~="ui-callout"] :is(p, ul, ol, pre, figure, table, details) { margin-block: .5rem; }
|
|
26
|
+
.markupress-prose [data-component~="ui-callout"] :is(p, ul, ol, pre, figure, table, details):first-child { margin-block-start: 0; }
|
|
27
|
+
.markupress-prose [data-component~="ui-callout"] :is(p, ul, ol, pre, figure, table, details):last-child { margin-block-end: 0; }
|
|
28
|
+
.markupress-prose :is([data-component~="ui-callout"], [data-component~="ui-tabs"]) pre { overflow: auto; max-width: 100%; padding: 1rem; background: var(--ui-surface-sunken); border-radius: .5rem; }
|
|
29
|
+
.markupress-prose :is([data-component~="ui-callout"], [data-component~="ui-tabs"]) code { font-size: .9em; }
|
|
30
|
+
.markupress-prose :is([data-component~="ui-callout"], [data-component~="ui-tabs"]) figure.code { margin: 1rem 0; }
|
|
31
|
+
.markupress-prose :is([data-component~="ui-callout"], [data-component~="ui-tabs"]) figure.code > pre { margin: 0; }
|
|
32
|
+
.markupress-prose [data-component~="ui-tabs"] figure.code:only-child { margin: 0; }
|
|
33
|
+
.markupress-prose .code-group section { padding-inline: 0; }
|
|
34
|
+
/* Code blocks. Highlighted lines and line numbers are classes written at build time; a highlighted line tints the page
|
|
35
|
+
surface, which contrasts more with the code than the block's sunken surface does. The copy and wrap buttons stay
|
|
36
|
+
hidden until the page's code controller connects, and show while the block is hovered or holds focus. */
|
|
37
|
+
.markupress-prose figure.code { position: relative; }
|
|
38
|
+
.markupress-prose .code-actions { position: absolute; inset-block-start: .5rem; inset-inline-end: .5rem; display: flex; gap: .25rem; opacity: 0; transition: opacity var(--ui-motion-fast, .12s); }
|
|
39
|
+
.markupress-prose figure.code > figcaption ~ .code-actions { inset-block-start: 0; }
|
|
40
|
+
.markupress-prose .code-actions[hidden] { display: none; }
|
|
41
|
+
.markupress-prose figure.code:is(:hover, :focus-within) .code-actions { opacity: 1; }
|
|
42
|
+
@media (hover: none) { .markupress-prose .code-actions { opacity: 1; } }
|
|
43
|
+
.markupress-prose .code-actions button { padding: .3rem .5rem; border: 1px solid var(--ui-border, #8885); border-radius: var(--ui-radius-sm, .25rem); background: var(--ui-surface); color: var(--ui-text); font: .75rem/1 system-ui, sans-serif; cursor: pointer; }
|
|
44
|
+
.markupress-prose .code-actions button[aria-pressed="true"] { border-color: var(--ui-accent); }
|
|
45
|
+
.markupress-prose pre.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
46
|
+
.markupress-prose pre .line.highlighted { display: inline-block; box-sizing: content-box; min-inline-size: 100%; margin-inline: -1rem; padding-inline: 1rem; background: color-mix(in srgb, var(--ui-accent) 10%, var(--ui-surface)); box-shadow: inset 2px 0 var(--ui-accent); }
|
|
47
|
+
.markupress-prose pre.line-numbers code { counter-reset: line; }
|
|
48
|
+
.markupress-prose pre.line-numbers .line::before { counter-increment: line; content: counter(line); display: inline-block; inline-size: 2ch; margin-inline-end: 1.5ch; text-align: end; color: var(--ui-text-muted, #888); user-select: none; }
|
|
49
|
+
/* The logo for the theme in use: the head script sets data-theme before first paint, and without it the light logo shows. */
|
|
50
|
+
[data-component~="markupress-shell"] .logo-dark { display: none; }
|
|
51
|
+
:root[data-theme="dark"] [data-component~="markupress-shell"] .logo-dark { display: inline; }
|
|
52
|
+
:root[data-theme="dark"] [data-component~="markupress-shell"] .logo-light { display: none; }
|