markopress 0.0.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/bin/cli.js +16 -0
- package/dist/build/index.d.ts +83 -0
- package/dist/build/index.d.ts.map +1 -0
- package/dist/build/index.js +1553 -0
- package/dist/build/index.js.map +1 -0
- package/dist/build/manifest-generator.d.ts +34 -0
- package/dist/build/manifest-generator.d.ts.map +1 -0
- package/dist/build/manifest-generator.js +86 -0
- package/dist/build/manifest-generator.js.map +1 -0
- package/dist/build/security.test.d.ts +6 -0
- package/dist/build/security.test.d.ts.map +1 -0
- package/dist/build/security.test.js +88 -0
- package/dist/build/security.test.js.map +1 -0
- package/dist/build/types.d.ts +21 -0
- package/dist/build/types.d.ts.map +1 -0
- package/dist/build/types.js +5 -0
- package/dist/build/types.js.map +1 -0
- package/dist/build/vite-config.test.d.ts +2 -0
- package/dist/build/vite-config.test.d.ts.map +1 -0
- package/dist/build/vite-config.test.js +53 -0
- package/dist/build/vite-config.test.js.map +1 -0
- package/dist/build/vite-markdown-plugin.d.ts +13 -0
- package/dist/build/vite-markdown-plugin.d.ts.map +1 -0
- package/dist/build/vite-markdown-plugin.js +134 -0
- package/dist/build/vite-markdown-plugin.js.map +1 -0
- package/dist/build/vite-markdown-plugin.test.d.ts +2 -0
- package/dist/build/vite-markdown-plugin.test.d.ts.map +1 -0
- package/dist/build/vite-markdown-plugin.test.js +41 -0
- package/dist/build/vite-markdown-plugin.test.js.map +1 -0
- package/dist/cli/index.d.ts +6 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +75 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/config/app-root.d.ts +11 -0
- package/dist/config/app-root.d.ts.map +1 -0
- package/dist/config/app-root.js +24 -0
- package/dist/config/app-root.js.map +1 -0
- package/dist/config/app-root.test.d.ts +2 -0
- package/dist/config/app-root.test.d.ts.map +1 -0
- package/dist/config/app-root.test.js +71 -0
- package/dist/config/app-root.test.js.map +1 -0
- package/dist/config/index.d.ts +6 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +6 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/loader.d.ts +25 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +187 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/loader.test.d.ts +2 -0
- package/dist/config/loader.test.d.ts.map +1 -0
- package/dist/config/loader.test.js +24 -0
- package/dist/config/loader.test.js.map +1 -0
- package/dist/config/types.d.ts +149 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +5 -0
- package/dist/config/types.js.map +1 -0
- package/dist/config/validation.d.ts +188 -0
- package/dist/config/validation.d.ts.map +1 -0
- package/dist/config/validation.js +139 -0
- package/dist/config/validation.js.map +1 -0
- package/dist/content/index.d.ts +6 -0
- package/dist/content/index.d.ts.map +1 -0
- package/dist/content/index.js +6 -0
- package/dist/content/index.js.map +1 -0
- package/dist/content/registry.d.ts +29 -0
- package/dist/content/registry.d.ts.map +1 -0
- package/dist/content/registry.js +45 -0
- package/dist/content/registry.js.map +1 -0
- package/dist/content/scanner.d.ts +9 -0
- package/dist/content/scanner.d.ts.map +1 -0
- package/dist/content/scanner.js +115 -0
- package/dist/content/scanner.js.map +1 -0
- package/dist/content/types.d.ts +41 -0
- package/dist/content/types.d.ts.map +1 -0
- package/dist/content/types.js +5 -0
- package/dist/content/types.js.map +1 -0
- package/dist/dev/index.d.ts +18 -0
- package/dist/dev/index.d.ts.map +1 -0
- package/dist/dev/index.js +93 -0
- package/dist/dev/index.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/markdown/code.d.ts +79 -0
- package/dist/markdown/code.d.ts.map +1 -0
- package/dist/markdown/code.js +305 -0
- package/dist/markdown/code.js.map +1 -0
- package/dist/markdown/containers.d.ts +17 -0
- package/dist/markdown/containers.d.ts.map +1 -0
- package/dist/markdown/containers.js +143 -0
- package/dist/markdown/containers.js.map +1 -0
- package/dist/markdown/includes.d.ts +18 -0
- package/dist/markdown/includes.d.ts.map +1 -0
- package/dist/markdown/includes.js +9 -0
- package/dist/markdown/includes.js.map +1 -0
- package/dist/markdown/index.d.ts +8 -0
- package/dist/markdown/index.d.ts.map +1 -0
- package/dist/markdown/index.js +8 -0
- package/dist/markdown/index.js.map +1 -0
- package/dist/markdown/loader.d.ts +31 -0
- package/dist/markdown/loader.d.ts.map +1 -0
- package/dist/markdown/loader.js +325 -0
- package/dist/markdown/loader.js.map +1 -0
- package/dist/markdown/preserve-tags.d.ts +16 -0
- package/dist/markdown/preserve-tags.d.ts.map +1 -0
- package/dist/markdown/preserve-tags.js +233 -0
- package/dist/markdown/preserve-tags.js.map +1 -0
- package/dist/markdown/renderer.d.ts +28 -0
- package/dist/markdown/renderer.d.ts.map +1 -0
- package/dist/markdown/renderer.js +146 -0
- package/dist/markdown/renderer.js.map +1 -0
- package/dist/markdown/tag-validator.d.ts +64 -0
- package/dist/markdown/tag-validator.d.ts.map +1 -0
- package/dist/markdown/tag-validator.js +118 -0
- package/dist/markdown/tag-validator.js.map +1 -0
- package/dist/markdown/types.d.ts +44 -0
- package/dist/markdown/types.d.ts.map +1 -0
- package/dist/markdown/types.js +5 -0
- package/dist/markdown/types.js.map +1 -0
- package/dist/plugin/compat.d.ts +14 -0
- package/dist/plugin/compat.d.ts.map +1 -0
- package/dist/plugin/compat.js +78 -0
- package/dist/plugin/compat.js.map +1 -0
- package/dist/plugin/context.d.ts +38 -0
- package/dist/plugin/context.d.ts.map +1 -0
- package/dist/plugin/context.js +103 -0
- package/dist/plugin/context.js.map +1 -0
- package/dist/plugin/index.d.ts +6 -0
- package/dist/plugin/index.d.ts.map +1 -0
- package/dist/plugin/index.js +6 -0
- package/dist/plugin/index.js.map +1 -0
- package/dist/plugin/manager.d.ts +112 -0
- package/dist/plugin/manager.d.ts.map +1 -0
- package/dist/plugin/manager.js +385 -0
- package/dist/plugin/manager.js.map +1 -0
- package/dist/plugin/types.d.ts +182 -0
- package/dist/plugin/types.d.ts.map +1 -0
- package/dist/plugin/types.js +5 -0
- package/dist/plugin/types.js.map +1 -0
- package/dist/plugins/blog-index/index.d.ts +18 -0
- package/dist/plugins/blog-index/index.d.ts.map +1 -0
- package/dist/plugins/blog-index/index.js +158 -0
- package/dist/plugins/blog-index/index.js.map +1 -0
- package/dist/plugins/sidenav/index.d.ts +36 -0
- package/dist/plugins/sidenav/index.d.ts.map +1 -0
- package/dist/plugins/sidenav/index.js +86 -0
- package/dist/plugins/sidenav/index.js.map +1 -0
- package/dist/plugins/toc/index.d.ts +38 -0
- package/dist/plugins/toc/index.d.ts.map +1 -0
- package/dist/plugins/toc/index.js +79 -0
- package/dist/plugins/toc/index.js.map +1 -0
- package/dist/preview/index.d.ts +7 -0
- package/dist/preview/index.d.ts.map +1 -0
- package/dist/preview/index.js +25 -0
- package/dist/preview/index.js.map +1 -0
- package/dist/theme/default/build/generate-all.d.ts +9 -0
- package/dist/theme/default/build/generate-all.d.ts.map +1 -0
- package/dist/theme/default/build/generate-all.js +85 -0
- package/dist/theme/default/build/generate-all.js.map +1 -0
- package/dist/theme/default/build/generate-css.d.ts +19 -0
- package/dist/theme/default/build/generate-css.d.ts.map +1 -0
- package/dist/theme/default/build/generate-css.js +199 -0
- package/dist/theme/default/build/generate-css.js.map +1 -0
- package/dist/theme/default/build/index.d.ts +5 -0
- package/dist/theme/default/build/index.d.ts.map +1 -0
- package/dist/theme/default/build/index.js +5 -0
- package/dist/theme/default/build/index.js.map +1 -0
- package/dist/theme/default/design-systems/default.d.ts +12 -0
- package/dist/theme/default/design-systems/default.d.ts.map +1 -0
- package/dist/theme/default/design-systems/default.js +289 -0
- package/dist/theme/default/design-systems/default.js.map +1 -0
- package/dist/theme/default/design-systems/docusaurus.d.ts +12 -0
- package/dist/theme/default/design-systems/docusaurus.d.ts.map +1 -0
- package/dist/theme/default/design-systems/docusaurus.js +299 -0
- package/dist/theme/default/design-systems/docusaurus.js.map +1 -0
- package/dist/theme/default/design-systems/index.d.ts +50 -0
- package/dist/theme/default/design-systems/index.d.ts.map +1 -0
- package/dist/theme/default/design-systems/index.js +54 -0
- package/dist/theme/default/design-systems/index.js.map +1 -0
- package/dist/theme/default/design-systems/rspress.d.ts +12 -0
- package/dist/theme/default/design-systems/rspress.d.ts.map +1 -0
- package/dist/theme/default/design-systems/rspress.js +299 -0
- package/dist/theme/default/design-systems/rspress.js.map +1 -0
- package/dist/theme/default/design-systems/types.d.ts +238 -0
- package/dist/theme/default/design-systems/types.d.ts.map +1 -0
- package/dist/theme/default/design-systems/types.js +6 -0
- package/dist/theme/default/design-systems/types.js.map +1 -0
- package/dist/theme/default/design-systems/vitepress.d.ts +12 -0
- package/dist/theme/default/design-systems/vitepress.d.ts.map +1 -0
- package/dist/theme/default/design-systems/vitepress.js +299 -0
- package/dist/theme/default/design-systems/vitepress.js.map +1 -0
- package/dist/theme/default/index.d.ts +60 -0
- package/dist/theme/default/index.d.ts.map +1 -0
- package/dist/theme/default/index.js +44 -0
- package/dist/theme/default/index.js.map +1 -0
- package/dist/theme/default/theme.d.ts +14 -0
- package/dist/theme/default/theme.d.ts.map +1 -0
- package/dist/theme/default/theme.js +58 -0
- package/dist/theme/default/theme.js.map +1 -0
- package/dist/theme/index.d.ts +6 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +6 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/loader.d.ts +21 -0
- package/dist/theme/loader.d.ts.map +1 -0
- package/dist/theme/loader.js +125 -0
- package/dist/theme/loader.js.map +1 -0
- package/dist/theme/types.d.ts +73 -0
- package/dist/theme/types.d.ts.map +1 -0
- package/dist/theme/types.js +5 -0
- package/dist/theme/types.js.map +1 -0
- package/dist/vite/index.d.ts +6 -0
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.js +6 -0
- package/dist/vite/index.js.map +1 -0
- package/dist/vite/markdownPlugin.d.ts +15 -0
- package/dist/vite/markdownPlugin.d.ts.map +1 -0
- package/dist/vite/markdownPlugin.js +111 -0
- package/dist/vite/markdownPlugin.js.map +1 -0
- package/dist/vite/plugin.d.ts +18 -0
- package/dist/vite/plugin.d.ts.map +1 -0
- package/dist/vite/plugin.js +94 -0
- package/dist/vite/plugin.js.map +1 -0
- package/marko.json +3 -0
- package/package.json +109 -0
- package/src/theme/default/build/generate-all.ts +99 -0
- package/src/theme/default/build/generate-css.ts +234 -0
- package/src/theme/default/build/index.ts +5 -0
- package/src/theme/default/components/doc-footer.marko +180 -0
- package/src/theme/default/components/footer.marko +32 -0
- package/src/theme/default/components/header.marko +49 -0
- package/src/theme/default/components/nav-bar.marko +191 -0
- package/src/theme/default/components/page-header.marko +20 -0
- package/src/theme/default/components/reading-progress.marko +36 -0
- package/src/theme/default/components/search.marko +239 -0
- package/src/theme/default/components/sidebar.marko +211 -0
- package/src/theme/default/components/site-footer.marko +211 -0
- package/src/theme/default/components/skip-link.marko +49 -0
- package/src/theme/default/components/theme/theme-aside-bottom.marko +1 -0
- package/src/theme/default/components/theme/theme-aside-top.marko +1 -0
- package/src/theme/default/components/theme/theme-body-bottom.marko +1 -0
- package/src/theme/default/components/theme/theme-body-top.marko +1 -0
- package/src/theme/default/components/theme/theme-doc-bottom.marko +1 -0
- package/src/theme/default/components/theme/theme-doc-footer-after.marko +1 -0
- package/src/theme/default/components/theme/theme-doc-footer-before.marko +1 -0
- package/src/theme/default/components/theme/theme-doc-top.marko +1 -0
- package/src/theme/default/components/theme/theme-head-bottom.marko +1 -0
- package/src/theme/default/components/theme/theme-head-top.marko +1 -0
- package/src/theme/default/components/theme/theme-home-features-after.marko +1 -0
- package/src/theme/default/components/theme/theme-home-hero-after.marko +1 -0
- package/src/theme/default/components/theme/theme-home-hero-before.marko +1 -0
- package/src/theme/default/components/theme/theme-navbar-center.marko +5 -0
- package/src/theme/default/components/theme/theme-navbar-end.marko +30 -0
- package/src/theme/default/components/theme/theme-navbar-start.marko +1 -0
- package/src/theme/default/components/theme/theme-page-bottom.marko +1 -0
- package/src/theme/default/components/theme/theme-page-top.marko +1 -0
- package/src/theme/default/components/theme/theme-sidebar-bottom.marko +1 -0
- package/src/theme/default/components/theme/theme-sidebar-top.marko +1 -0
- package/src/theme/default/components/theme/theme-toc-item.marko +1 -0
- package/src/theme/default/components/theme-toggle.marko +122 -0
- package/src/theme/default/components/toc.marko +140 -0
- package/src/theme/default/design-systems/default.ts +331 -0
- package/src/theme/default/design-systems/docusaurus.ts +341 -0
- package/src/theme/default/design-systems/index.ts +67 -0
- package/src/theme/default/design-systems/rspress.ts +341 -0
- package/src/theme/default/design-systems/types.ts +296 -0
- package/src/theme/default/design-systems/vitepress.ts +341 -0
- package/src/theme/default/index.ts +107 -0
- package/src/theme/default/layouts/blog.marko +65 -0
- package/src/theme/default/layouts/content-page.marko +41 -0
- package/src/theme/default/layouts/default.marko +209 -0
- package/src/theme/default/layouts/docs.marko +81 -0
- package/src/theme/default/layouts/home-page.marko +19 -0
- package/src/theme/default/layouts/page.marko +51 -0
- package/src/theme/default/public/theme-default.css +1081 -0
- package/src/theme/default/public/theme-docusaurus.css +1081 -0
- package/src/theme/default/public/theme-vitepress.css +1081 -0
- package/src/theme/default/public/theme.css +2 -0
- package/src/theme/default/routes/+layout.marko +57 -0
- package/src/theme/default/styles/main.css +249 -0
- package/src/theme/default/styles-base.css +757 -0
- package/src/theme/default/styles.css +899 -0
- package/src/theme/default/taglib.json +18 -0
- package/src/theme/default/tags/doc-footer.marko +180 -0
- package/src/theme/default/tags/footer.marko +32 -0
- package/src/theme/default/tags/header.marko +49 -0
- package/src/theme/default/tags/nav-bar.marko +191 -0
- package/src/theme/default/tags/page-header.marko +20 -0
- package/src/theme/default/tags/reading-progress.marko +36 -0
- package/src/theme/default/tags/search.marko +239 -0
- package/src/theme/default/tags/sidebar.marko +211 -0
- package/src/theme/default/tags/site-footer.marko +211 -0
- package/src/theme/default/tags/skip-link.marko +49 -0
- package/src/theme/default/tags/theme-aside-bottom.marko +1 -0
- package/src/theme/default/tags/theme-aside-top.marko +1 -0
- package/src/theme/default/tags/theme-body-bottom.marko +1 -0
- package/src/theme/default/tags/theme-body-top.marko +1 -0
- package/src/theme/default/tags/theme-doc-bottom.marko +1 -0
- package/src/theme/default/tags/theme-doc-footer-after.marko +1 -0
- package/src/theme/default/tags/theme-doc-footer-before.marko +1 -0
- package/src/theme/default/tags/theme-doc-top.marko +1 -0
- package/src/theme/default/tags/theme-head-bottom.marko +1 -0
- package/src/theme/default/tags/theme-head-top.marko +1 -0
- package/src/theme/default/tags/theme-home-features-after.marko +1 -0
- package/src/theme/default/tags/theme-home-hero-after.marko +1 -0
- package/src/theme/default/tags/theme-home-hero-before.marko +1 -0
- package/src/theme/default/tags/theme-navbar-center.marko +5 -0
- package/src/theme/default/tags/theme-navbar-end.marko +30 -0
- package/src/theme/default/tags/theme-navbar-start.marko +1 -0
- package/src/theme/default/tags/theme-page-bottom.marko +1 -0
- package/src/theme/default/tags/theme-page-top.marko +1 -0
- package/src/theme/default/tags/theme-sidebar-bottom.marko +1 -0
- package/src/theme/default/tags/theme-sidebar-top.marko +1 -0
- package/src/theme/default/tags/theme-toc-item.marko +1 -0
- package/src/theme/default/tags/theme-toggle.marko +122 -0
- package/src/theme/default/tags/toc.marko +140 -0
- package/src/theme/default/theme.ts +83 -0
- package/templates/blog-post.marko.template +13 -0
- package/templates/catch-all-handler.js.template +90 -0
- package/templates/catch-all-page.marko.template +69 -0
- package/templates/doc.marko.template +6 -0
- package/templates/example-tags/README.md +212 -0
- package/templates/example-tags/alert-box.marko +98 -0
- package/templates/example-tags/button-primary.marko +28 -0
- package/templates/example-tags/button-secondary.marko +28 -0
- package/templates/example-tags/button.marko +6 -0
- package/templates/example-tags/card-body.marko +8 -0
- package/templates/example-tags/card-footer.marko +7 -0
- package/templates/example-tags/card-header.marko +7 -0
- package/templates/example-tags/card.marko +20 -0
- package/templates/example-tags/icon.marko +149 -0
- package/templates/layout.marko.template +64 -0
- package/templates/page.marko.template +6 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CSS Generation Script
|
|
3
|
+
* Generates all theme CSS variants from design systems
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { writeFile, mkdir, copyFile, readFile } from 'fs/promises';
|
|
7
|
+
import { dirname, resolve } from 'path';
|
|
8
|
+
import { fileURLToPath } from 'url';
|
|
9
|
+
import { readdir } from 'fs/promises';
|
|
10
|
+
import { generateThemeCSS } from './generate-css.js';
|
|
11
|
+
import { designSystems } from '../design-systems/index.js';
|
|
12
|
+
|
|
13
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
const publicDir = resolve(__dirname, '../public');
|
|
15
|
+
const componentsDir = resolve(__dirname, '../components');
|
|
16
|
+
const distTagsDir = resolve(__dirname, '../tags');
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Copy Marko components to dist/tags for export
|
|
20
|
+
* Recursively copies from src/components and subdirectories
|
|
21
|
+
*/
|
|
22
|
+
async function copyComponentsToDist() {
|
|
23
|
+
try {
|
|
24
|
+
// Ensure dist/tags directory exists
|
|
25
|
+
await mkdir(distTagsDir, { recursive: true });
|
|
26
|
+
|
|
27
|
+
// Recursively get all .marko files from src/components
|
|
28
|
+
async function getMarkoFiles(dir: string): Promise<string[]> {
|
|
29
|
+
const entries = await readdir(dir, { withFileTypes: true });
|
|
30
|
+
const files: string[] = [];
|
|
31
|
+
|
|
32
|
+
for (const entry of entries) {
|
|
33
|
+
const fullPath = resolve(dir, entry.name);
|
|
34
|
+
if (entry.isDirectory()) {
|
|
35
|
+
const subFiles = await getMarkoFiles(fullPath);
|
|
36
|
+
files.push(...subFiles);
|
|
37
|
+
} else if (entry.isFile() && entry.name.endsWith('.marko')) {
|
|
38
|
+
files.push(fullPath);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return files;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const markoFiles = await getMarkoFiles(componentsDir);
|
|
45
|
+
|
|
46
|
+
// Copy each .marko file to dist/tags
|
|
47
|
+
// Files in subdirectories get flattened (theme/ThemeNavbarEnd.marko -> ThemeNavbarEnd.marko)
|
|
48
|
+
for (const srcPath of markoFiles) {
|
|
49
|
+
const fileName = srcPath.split('/').pop()!; // Get just the filename
|
|
50
|
+
const destPath = resolve(distTagsDir, fileName);
|
|
51
|
+
|
|
52
|
+
await copyFile(srcPath, destPath);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
console.log(`✓ Copied ${markoFiles.length} component(s) to dist/tags`);
|
|
56
|
+
} catch (error) {
|
|
57
|
+
// Silently skip if components dir doesn't exist yet
|
|
58
|
+
if ((error as NodeJS.ErrnoException).code !== 'ENOENT') {
|
|
59
|
+
console.error('Warning: Failed to copy components:', error);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Generate all theme CSS variants
|
|
66
|
+
*/
|
|
67
|
+
export async function generateAllThemes() {
|
|
68
|
+
const styles = ['default', 'vitepress', 'docusaurus'] as const;
|
|
69
|
+
|
|
70
|
+
console.log('Generating theme CSS files...\n');
|
|
71
|
+
|
|
72
|
+
// Read the component styles (includes line numbers, code blocks, etc.)
|
|
73
|
+
const stylesCssPath = resolve(__dirname, '../styles.css');
|
|
74
|
+
const componentStyles = await readFile(stylesCssPath, 'utf-8');
|
|
75
|
+
|
|
76
|
+
for (const style of styles) {
|
|
77
|
+
const system = designSystems[style];
|
|
78
|
+
const css = generateThemeCSS(system);
|
|
79
|
+
const outputPath = resolve(publicDir, `theme-${style}.css`);
|
|
80
|
+
|
|
81
|
+
// Combine design system CSS + component styles
|
|
82
|
+
const fullCss = `${css}\n\n/* Component Styles */\n${componentStyles}`;
|
|
83
|
+
await writeFile(outputPath, fullCss, 'utf-8');
|
|
84
|
+
console.log(`✓ Generated theme-${style}.css`);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
console.log('\nCopying Marko components to dist/tags...\n');
|
|
88
|
+
await copyComponentsToDist();
|
|
89
|
+
|
|
90
|
+
console.log('\n✨ All theme assets generated successfully!');
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Run if called directly
|
|
94
|
+
if (process.argv[1] === fileURLToPath(import.meta.url)) {
|
|
95
|
+
generateAllThemes().catch((error) => {
|
|
96
|
+
console.error('Error generating CSS files:', error);
|
|
97
|
+
process.exit(1);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CSS Variable Generator
|
|
3
|
+
* Converts design tokens into CSS custom properties
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { DesignSystem, ColorTokens, TypographyTokens, SpacingTokens, EffectTokens, LayoutTokens } from '../design-systems/types.js';
|
|
7
|
+
import { getDarkModeOverride as getDarkOverride, type DesignSystemName } from '../design-systems/index.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Generate CSS variables from design system
|
|
11
|
+
* @param designSystem - Design system object
|
|
12
|
+
* @param darkMode - Whether to generate dark mode variables
|
|
13
|
+
* @returns CSS string with :root variables
|
|
14
|
+
*/
|
|
15
|
+
export function generateCSSVariables(designSystem: DesignSystem, darkMode: boolean = false): string {
|
|
16
|
+
const lines: string[] = [];
|
|
17
|
+
|
|
18
|
+
// Root selector
|
|
19
|
+
lines.push(darkMode ? ':root.dark,' : ':root,');
|
|
20
|
+
lines.push(darkMode ? 'html.dark {' : 'html {');
|
|
21
|
+
|
|
22
|
+
// Colors
|
|
23
|
+
generateColorVariables(lines, designSystem.colors);
|
|
24
|
+
|
|
25
|
+
// Typography
|
|
26
|
+
generateTypographyVariables(lines, designSystem.typography);
|
|
27
|
+
|
|
28
|
+
// Spacing
|
|
29
|
+
generateSpacingVariables(lines, designSystem.spacing);
|
|
30
|
+
|
|
31
|
+
// Effects (shadows, border radius, transitions)
|
|
32
|
+
generateEffectVariables(lines, designSystem.effects);
|
|
33
|
+
|
|
34
|
+
// Layout (dimensions, z-index)
|
|
35
|
+
generateLayoutVariables(lines, designSystem.layout);
|
|
36
|
+
|
|
37
|
+
lines.push('}');
|
|
38
|
+
|
|
39
|
+
return lines.join('\n');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Generate color CSS variables
|
|
44
|
+
*/
|
|
45
|
+
function generateColorVariables(lines: string[], colors: ColorTokens): void {
|
|
46
|
+
// Primary colors
|
|
47
|
+
lines.push(` --color-primary-1: ${colors.primary['1']};`);
|
|
48
|
+
lines.push(` --color-primary-2: ${colors.primary['2']};`);
|
|
49
|
+
lines.push(` --color-primary-3: ${colors.primary['3']};`);
|
|
50
|
+
lines.push(` --color-primary-soft: ${colors.primary.soft};`);
|
|
51
|
+
|
|
52
|
+
// Semantic colors (success, warning, danger, info)
|
|
53
|
+
(['success', 'warning', 'danger', 'info'] as const).forEach((color) => {
|
|
54
|
+
lines.push(` --color-${color}-1: ${colors[color]['1']};`);
|
|
55
|
+
lines.push(` --color-${color}-2: ${colors[color]['2']};`);
|
|
56
|
+
lines.push(` --color-${color}-3: ${colors[color]['3']};`);
|
|
57
|
+
lines.push(` --color-${color}-soft: ${colors[color].soft};`);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// Gray scale
|
|
61
|
+
lines.push(` --color-gray-1: ${colors.gray['1']};`);
|
|
62
|
+
lines.push(` --color-gray-2: ${colors.gray['2']};`);
|
|
63
|
+
lines.push(` --color-gray-3: ${colors.gray['3']};`);
|
|
64
|
+
lines.push(` --color-gray-soft: ${colors.gray.soft};`);
|
|
65
|
+
|
|
66
|
+
// Background colors
|
|
67
|
+
lines.push(` --bg-default: ${colors.bg.default};`);
|
|
68
|
+
lines.push(` --bg-alt: ${colors.bg.alt};`);
|
|
69
|
+
lines.push(` --bg-elevated: ${colors.bg.elevated};`);
|
|
70
|
+
lines.push(` --bg-soft: ${colors.bg.soft};`);
|
|
71
|
+
|
|
72
|
+
// Text colors
|
|
73
|
+
lines.push(` --text-1: ${colors.text['1']};`);
|
|
74
|
+
lines.push(` --text-2: ${colors.text['2']};`);
|
|
75
|
+
lines.push(` --text-3: ${colors.text['3']};`);
|
|
76
|
+
|
|
77
|
+
// Border colors
|
|
78
|
+
lines.push(` --border-default: ${colors.border.default};`);
|
|
79
|
+
lines.push(` --border-divider: ${colors.border.divider};`);
|
|
80
|
+
lines.push(` --border-gutter: ${colors.border.gutter};`);
|
|
81
|
+
|
|
82
|
+
// Divider
|
|
83
|
+
lines.push(` --divider: ${colors.divider};`);
|
|
84
|
+
|
|
85
|
+
// Soft backgrounds
|
|
86
|
+
lines.push(` --soft-brand: ${colors.soft.brand};`);
|
|
87
|
+
lines.push(` --soft-gray: ${colors.soft.gray};`);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Generate typography CSS variables
|
|
92
|
+
*/
|
|
93
|
+
function generateTypographyVariables(lines: string[], typography: TypographyTokens): void {
|
|
94
|
+
// Font families
|
|
95
|
+
lines.push(` --font-sans: ${typography.fontFamily.sans};`);
|
|
96
|
+
lines.push(` --font-mono: ${typography.fontFamily.mono};`);
|
|
97
|
+
|
|
98
|
+
// Font sizes
|
|
99
|
+
lines.push(` --font-size-xs: ${typography.fontSize.xs};`);
|
|
100
|
+
lines.push(` --font-size-sm: ${typography.fontSize.sm};`);
|
|
101
|
+
lines.push(` --font-size-base: ${typography.fontSize.base};`);
|
|
102
|
+
lines.push(` --font-size-lg: ${typography.fontSize.lg};`);
|
|
103
|
+
lines.push(` --font-size-xl: ${typography.fontSize.xl};`);
|
|
104
|
+
lines.push(` --font-size-2xl: ${typography.fontSize['2xl']};`);
|
|
105
|
+
lines.push(` --font-size-3xl: ${typography.fontSize['3xl']};`);
|
|
106
|
+
lines.push(` --font-size-4xl: ${typography.fontSize['4xl']};`);
|
|
107
|
+
|
|
108
|
+
// Font weights
|
|
109
|
+
lines.push(` --font-weight-normal: ${typography.fontWeight.normal};`);
|
|
110
|
+
lines.push(` --font-weight-medium: ${typography.fontWeight.medium};`);
|
|
111
|
+
lines.push(` --font-weight-semibold: ${typography.fontWeight.semibold};`);
|
|
112
|
+
lines.push(` --font-weight-bold: ${typography.fontWeight.bold};`);
|
|
113
|
+
|
|
114
|
+
// Line heights
|
|
115
|
+
lines.push(` --line-height-tight: ${typography.lineHeight.tight};`);
|
|
116
|
+
lines.push(` --line-height-normal: ${typography.lineHeight.normal};`);
|
|
117
|
+
lines.push(` --line-height-relaxed: ${typography.lineHeight.relaxed};`);
|
|
118
|
+
|
|
119
|
+
// Letter spacing (optional)
|
|
120
|
+
if (typography.letterSpacing) {
|
|
121
|
+
if (typography.letterSpacing.tight) {
|
|
122
|
+
lines.push(` --letter-spacing-tight: ${typography.letterSpacing.tight};`);
|
|
123
|
+
}
|
|
124
|
+
if (typography.letterSpacing.normal) {
|
|
125
|
+
lines.push(` --letter-spacing-normal: ${typography.letterSpacing.normal};`);
|
|
126
|
+
}
|
|
127
|
+
if (typography.letterSpacing.wide) {
|
|
128
|
+
lines.push(` --letter-spacing-wide: ${typography.letterSpacing.wide};`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Generate spacing CSS variables
|
|
135
|
+
*/
|
|
136
|
+
function generateSpacingVariables(lines: string[], spacing: SpacingTokens): void {
|
|
137
|
+
lines.push(` --space-xs: ${spacing.scale.xs};`);
|
|
138
|
+
lines.push(` --space-sm: ${spacing.scale.sm};`);
|
|
139
|
+
lines.push(` --space-md: ${spacing.scale.md};`);
|
|
140
|
+
lines.push(` --space-lg: ${spacing.scale.lg};`);
|
|
141
|
+
lines.push(` --space-xl: ${spacing.scale.xl};`);
|
|
142
|
+
lines.push(` --space-2xl: ${spacing.scale['2xl']};`);
|
|
143
|
+
lines.push(` --space-3xl: ${spacing.scale['3xl']};`);
|
|
144
|
+
lines.push(` --space-4xl: ${spacing.scale['4xl']};`);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Generate effect CSS variables (shadows, border radius, transitions)
|
|
149
|
+
*/
|
|
150
|
+
function generateEffectVariables(lines: string[], effects: EffectTokens): void {
|
|
151
|
+
// Shadows
|
|
152
|
+
lines.push(` --shadow-1: ${effects.shadows['1']};`);
|
|
153
|
+
lines.push(` --shadow-2: ${effects.shadows['2']};`);
|
|
154
|
+
lines.push(` --shadow-3: ${effects.shadows['3']};`);
|
|
155
|
+
lines.push(` --shadow-4: ${effects.shadows['4']};`);
|
|
156
|
+
lines.push(` --shadow-5: ${effects.shadows['5']};`);
|
|
157
|
+
|
|
158
|
+
// Border radius
|
|
159
|
+
lines.push(` --radius-sm: ${effects.borderRadius.sm};`);
|
|
160
|
+
lines.push(` --radius-md: ${effects.borderRadius.md};`);
|
|
161
|
+
lines.push(` --radius-lg: ${effects.borderRadius.lg};`);
|
|
162
|
+
|
|
163
|
+
// Transitions
|
|
164
|
+
if (effects.transitions.base) {
|
|
165
|
+
lines.push(` --transition-base: ${effects.transitions.base};`);
|
|
166
|
+
}
|
|
167
|
+
if (effects.transitions.fast) {
|
|
168
|
+
lines.push(` --transition-fast: ${effects.transitions.fast};`);
|
|
169
|
+
}
|
|
170
|
+
if (effects.transitions.slow) {
|
|
171
|
+
lines.push(` --transition-slow: ${effects.transitions.slow};`);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Generate layout CSS variables (dimensions, z-index)
|
|
177
|
+
*/
|
|
178
|
+
function generateLayoutVariables(lines: string[], layout: LayoutTokens): void {
|
|
179
|
+
// Dimensions
|
|
180
|
+
lines.push(` --layout-max-width: ${layout.maxWidth};`);
|
|
181
|
+
lines.push(` --navbar-height: ${layout.navbarHeight};`);
|
|
182
|
+
lines.push(` --sidebar-width: ${layout.sidebarWidth};`);
|
|
183
|
+
if (layout.tocWidth) {
|
|
184
|
+
lines.push(` --toc-width: ${layout.tocWidth};`);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Z-index
|
|
188
|
+
lines.push(` --z-footer: ${layout.zIndex.footer};`);
|
|
189
|
+
lines.push(` --z-local-nav: ${layout.zIndex.localNav};`);
|
|
190
|
+
lines.push(` --z-nav: ${layout.zIndex.nav};`);
|
|
191
|
+
lines.push(` --z-layout-top: ${layout.zIndex.layoutTop};`);
|
|
192
|
+
lines.push(` --z-backdrop: ${layout.zIndex.backdrop};`);
|
|
193
|
+
lines.push(` --z-sidebar: ${layout.zIndex.sidebar};`);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Generate complete CSS theme file
|
|
198
|
+
* @param designSystem - Design system object
|
|
199
|
+
* @returns Complete CSS with light and dark mode
|
|
200
|
+
*/
|
|
201
|
+
export function generateThemeCSS(designSystem: DesignSystem): string {
|
|
202
|
+
const lines: string[] = [];
|
|
203
|
+
|
|
204
|
+
// Header comment
|
|
205
|
+
lines.push(`/*`);
|
|
206
|
+
lines.push(` * ${designSystem.name} Design System`);
|
|
207
|
+
lines.push(` * Version: ${designSystem.version}`);
|
|
208
|
+
if (designSystem.description) {
|
|
209
|
+
lines.push(` * ${designSystem.description}`);
|
|
210
|
+
}
|
|
211
|
+
lines.push(` * Auto-generated from design tokens`);
|
|
212
|
+
lines.push(` */`);
|
|
213
|
+
lines.push('');
|
|
214
|
+
|
|
215
|
+
// Light mode
|
|
216
|
+
lines.push(generateCSSVariables(designSystem, false));
|
|
217
|
+
lines.push('');
|
|
218
|
+
|
|
219
|
+
// Dark mode (if override exists)
|
|
220
|
+
const darkOverride = getDarkModeOverride(designSystem.name);
|
|
221
|
+
if (darkOverride) {
|
|
222
|
+
const darkSystem = { ...designSystem, ...darkOverride };
|
|
223
|
+
lines.push(generateCSSVariables(darkSystem, true));
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
return lines.join('\n');
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Get dark mode override for a design system
|
|
231
|
+
*/
|
|
232
|
+
function getDarkModeOverride(name: string): Partial<DesignSystem> | null {
|
|
233
|
+
return getDarkOverride(name as DesignSystemName) || null;
|
|
234
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Documentation Footer Component
|
|
3
|
+
* Displays edit link, last updated timestamp, and prev/next navigation
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
<script>
|
|
7
|
+
const formatDate = (date) => {
|
|
8
|
+
if (!date) return '';
|
|
9
|
+
if (typeof window === 'undefined') return date;
|
|
10
|
+
|
|
11
|
+
const d = new Date(date);
|
|
12
|
+
return d.toLocaleDateString('en-US', {
|
|
13
|
+
year: 'numeric',
|
|
14
|
+
month: 'long',
|
|
15
|
+
day: 'numeric'
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<footer class="doc-footer">
|
|
21
|
+
<!-- Edit Link -->
|
|
22
|
+
<if=input.editUrl>
|
|
23
|
+
<div class="doc-footer-edit">
|
|
24
|
+
<a
|
|
25
|
+
href=input.editUrl
|
|
26
|
+
target="_blank"
|
|
27
|
+
rel="noopener noreferrer"
|
|
28
|
+
class="edit-link">
|
|
29
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
30
|
+
<path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path>
|
|
31
|
+
<path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path>
|
|
32
|
+
</svg>
|
|
33
|
+
<span>Edit this page</span>
|
|
34
|
+
</a>
|
|
35
|
+
</div>
|
|
36
|
+
</if>
|
|
37
|
+
|
|
38
|
+
<!-- Last Updated -->
|
|
39
|
+
<if=input.lastUpdated>
|
|
40
|
+
<div class="doc-footer-updated">
|
|
41
|
+
<span class="updated-label">Last updated:</span>
|
|
42
|
+
<time datetime=input.lastUpdated>${formatDate(input.lastUpdated)}</time>
|
|
43
|
+
</div>
|
|
44
|
+
</if>
|
|
45
|
+
|
|
46
|
+
<!-- Prev/Next Navigation -->
|
|
47
|
+
<if=input.prev || input.next>
|
|
48
|
+
<div class="doc-footer-nav">
|
|
49
|
+
<!-- Previous Page -->
|
|
50
|
+
<if=input.prev>
|
|
51
|
+
<a class="page-nav-prev" href=input.prev.link>
|
|
52
|
+
<span class="page-nav-label">Previous</span>
|
|
53
|
+
<span class="page-nav-title">${input.prev.title}</span>
|
|
54
|
+
</a>
|
|
55
|
+
<else>
|
|
56
|
+
<div class="page-nav-spacer"></div>
|
|
57
|
+
</else>
|
|
58
|
+
|
|
59
|
+
<!-- Next Page -->
|
|
60
|
+
<if=input.next>
|
|
61
|
+
<a class="page-nav-next" href=input.next.link>
|
|
62
|
+
<span class="page-nav-label">Next</span>
|
|
63
|
+
<span class="page-nav-title">${input.next.title}</span>
|
|
64
|
+
</a>
|
|
65
|
+
</if>
|
|
66
|
+
</div>
|
|
67
|
+
</if>
|
|
68
|
+
</footer>
|
|
69
|
+
|
|
70
|
+
<style>
|
|
71
|
+
.doc-footer {
|
|
72
|
+
margin-top: var(--space-3xl);
|
|
73
|
+
padding-top: var(--space-xl);
|
|
74
|
+
border-top: 1px solid var(--border-default);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* Edit Link */
|
|
78
|
+
.doc-footer-edit {
|
|
79
|
+
margin-bottom: var(--space-md);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.edit-link {
|
|
83
|
+
display: inline-flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
gap: var(--space-xs);
|
|
86
|
+
color: var(--text-2);
|
|
87
|
+
font-size: var(--font-size-sm);
|
|
88
|
+
text-decoration: none;
|
|
89
|
+
transition: color var(--transition-fast);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.edit-link:hover {
|
|
93
|
+
color: var(--color-primary-2, #3a5ccc);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.edit-link svg {
|
|
97
|
+
flex-shrink: 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* Last Updated */
|
|
101
|
+
.doc-footer-updated {
|
|
102
|
+
margin-bottom: var(--space-lg);
|
|
103
|
+
font-size: var(--font-size-sm);
|
|
104
|
+
color: var(--text-3);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.updated-label {
|
|
108
|
+
margin-right: var(--space-xs);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* Prev/Next Navigation */
|
|
112
|
+
.doc-footer-nav {
|
|
113
|
+
display: grid;
|
|
114
|
+
grid-template-columns: 1fr 1fr;
|
|
115
|
+
gap: var(--space-md);
|
|
116
|
+
margin-top: var(--space-xl);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.page-nav-prev,
|
|
120
|
+
.page-nav-next {
|
|
121
|
+
display: flex;
|
|
122
|
+
flex-direction: column;
|
|
123
|
+
gap: var(--space-xs);
|
|
124
|
+
padding: var(--space-md);
|
|
125
|
+
background: var(--bg-alt);
|
|
126
|
+
border: 1px solid var(--border-default);
|
|
127
|
+
border-radius: var(--radius-lg, 12px);
|
|
128
|
+
text-decoration: none;
|
|
129
|
+
color: var(--text-1);
|
|
130
|
+
transition: all var(--transition-fast);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.page-nav-prev:hover,
|
|
134
|
+
.page-nav-next:hover {
|
|
135
|
+
border-color: var(--color-primary-2, #3a5ccc);
|
|
136
|
+
background: var(--bg-soft);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.page-nav-prev {
|
|
140
|
+
grid-column: 1;
|
|
141
|
+
text-align: left;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.page-nav-next {
|
|
145
|
+
grid-column: 2;
|
|
146
|
+
text-align: right;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.page-nav-spacer {
|
|
150
|
+
grid-column: 1;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.page-nav-label {
|
|
154
|
+
font-size: var(--font-size-xs);
|
|
155
|
+
font-weight: var(--font-weight-semibold);
|
|
156
|
+
text-transform: uppercase;
|
|
157
|
+
color: var(--text-2);
|
|
158
|
+
letter-spacing: 0.05em;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.page-nav-title {
|
|
162
|
+
font-size: var(--font-size-base);
|
|
163
|
+
font-weight: var(--font-weight-medium);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/* Mobile Responsive */
|
|
167
|
+
@media (max-width: 768px) {
|
|
168
|
+
.doc-footer-nav {
|
|
169
|
+
grid-template-columns: 1fr;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.page-nav-next {
|
|
173
|
+
grid-column: 1;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.page-nav-spacer {
|
|
177
|
+
display: none;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Footer component
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
<let/message=input.message || ''/>
|
|
6
|
+
<let/copyright=input.copyright || ''/>
|
|
7
|
+
|
|
8
|
+
<div class="site-footer">
|
|
9
|
+
<div class="footer-container">
|
|
10
|
+
<if=message>
|
|
11
|
+
<p class="footer-message">${message}</p>
|
|
12
|
+
</if>
|
|
13
|
+
<if=copyright>
|
|
14
|
+
<p class="footer-copyright">${copyright}</p>
|
|
15
|
+
</if>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<style>
|
|
20
|
+
.site-footer {
|
|
21
|
+
border-top: 1px solid var(--border-color);
|
|
22
|
+
padding: 2rem 0;
|
|
23
|
+
margin-top: 4rem;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.footer-container {
|
|
27
|
+
max-width: 1200px;
|
|
28
|
+
margin: 0 auto;
|
|
29
|
+
padding: 0 1rem;
|
|
30
|
+
text-align: center;
|
|
31
|
+
}
|
|
32
|
+
</style>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Header component
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
<let/siteTitle=input.siteTitle || 'MarkoPress'/>
|
|
6
|
+
<let/navItems=input.navItems || []/>
|
|
7
|
+
|
|
8
|
+
<div class="site-header">
|
|
9
|
+
<div class="header-container">
|
|
10
|
+
<a href="/" class="site-title">${siteTitle}</a>
|
|
11
|
+
<nav class="site-nav">
|
|
12
|
+
<for|item| in=navItems>
|
|
13
|
+
<a href=item.link class="nav-link">${item.text}</a>
|
|
14
|
+
</for>
|
|
15
|
+
</nav>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<style>
|
|
20
|
+
.site-header {
|
|
21
|
+
border-bottom: 1px solid var(--border-color);
|
|
22
|
+
padding: 1rem 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.header-container {
|
|
26
|
+
max-width: 1200px;
|
|
27
|
+
margin: 0 auto;
|
|
28
|
+
padding: 0 1rem;
|
|
29
|
+
display: flex;
|
|
30
|
+
justify-content: space-between;
|
|
31
|
+
align-items: center;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.site-title {
|
|
35
|
+
font-weight: bold;
|
|
36
|
+
text-decoration: none;
|
|
37
|
+
color: inherit;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.site-nav {
|
|
41
|
+
display: flex;
|
|
42
|
+
gap: 1.5rem;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.nav-link {
|
|
46
|
+
text-decoration: none;
|
|
47
|
+
color: inherit;
|
|
48
|
+
}
|
|
49
|
+
</style>
|