Skip to content

Commit dc5be90

Browse files
committed
docs: patch comark-docs for vitesse code themes; brand-green highlighted text
1 parent 10de041 commit dc5be90

8 files changed

Lines changed: 64 additions & 57 deletions

File tree

docs/app/assets/css/devframe.css

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,19 @@
1919
}
2020

2121
/*
22-
* The comark-docs layer pins the semantic `--ui-primary` to neutral for its
23-
* monochrome look; devframe uses its brand green as the primary accent
24-
* (buttons, links, active nav). Loaded after the layer's theme, so this wins.
22+
* The comark-docs layer pins the semantic `--ui-primary` and highlighted text
23+
* to neutral for its monochrome look; devframe uses its brand green for both
24+
* the primary accent (buttons, links, active nav) and highlighted text
25+
* (headings, emphasis). The doubled `:root:root` / `:root.dark` selectors give
26+
* these a higher specificity than the layer's plain `:root` / `.dark`, so they
27+
* win regardless of stylesheet load order.
2528
*/
26-
:root {
29+
:root:root {
2730
--ui-primary: var(--ui-color-primary-500);
31+
--ui-text-highlighted: var(--ui-color-primary-700);
2832
}
2933

30-
.dark {
34+
:root.dark {
3135
--ui-primary: var(--ui-color-primary-400);
36+
--ui-text-highlighted: var(--ui-color-primary-300);
3237
}

docs/nuxt.config.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import process from 'node:process'
2-
import { fileURLToPath } from 'node:url'
32

43
export default defineNuxtConfig({
54
compatibilityDate: '2026-08-21',
@@ -10,12 +9,6 @@ export default defineNuxtConfig({
109

1110
css: ['~/assets/css/devframe.css'],
1211

13-
// Redirect the layer's rangi highlighter import to a shim that renders code
14-
// with Shiki's vitesse-light / vitesse-dark themes.
15-
alias: {
16-
'comark/plugins/rangi': fileURLToPath(new URL('./shims/rangi.ts', import.meta.url)),
17-
},
18-
1912
site: {
2013
url: 'https://devfra.me',
2114
name: 'Devframe',

docs/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"docs:serve": "nuxt preview"
99
},
1010
"dependencies": {
11-
"@shikijs/themes": "catalog:docs",
1211
"comark-docs": "catalog:docs",
1312
"nuxt": "catalog:build",
1413
"ufo": "catalog:deps"

docs/shims/rangi.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

knip.jsonc

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,7 @@
4040
// Nuxt auto-registers `app/components` and `app/composables`; the files
4141
// here shadow same-named pieces of the comark-docs layer (AppHeaderBrand,
4242
// useFilteredNavigation, ...), so nothing imports them explicitly.
43-
// `shims/rangi.ts` is wired in through `nuxt.config.ts`'s `alias`.
44-
"entry": ["app/components/*.vue", "app/composables/*.ts", "shims/*.ts"],
45-
// `comark` is the comark-docs layer's own (pkg.pr.new pinned) dep; the
46-
// rangi->shiki shim imports `comark/plugins/shiki` from it, resolved
47-
// through the workspace's hoisted store.
48-
"ignoreDependencies": ["comark"]
43+
"entry": ["app/components/*.vue", "app/composables/*.ts"]
4944
},
5045
"examples/hub-next": {
5146
// The React client build's root sits at `src/client` (`next dev

patches/comark-docs@0.0.1.patch

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
diff --git a/server/utils/content.ts b/server/utils/content.ts
2+
index e30eeb312d00dd6111b5574680e6b8b725d7cb76..2d6d6e570dfef6537276dc4a613f3cd5fcbf4e8c 100644
3+
--- a/server/utils/content.ts
4+
+++ b/server/utils/content.ts
5+
@@ -1,14 +1,15 @@
6+
import { defineContentPlugin, type ComarkContent, type CacheOptions, comarkContent } from 'comark-content';
7+
import fs from 'comark-content/sources/fs'
8+
import github from 'comark-content/sources/github'
9+
-import rangi from 'comark/plugins/rangi'
10+
+import shiki from 'comark/plugins/shiki'
11+
import security from 'comark/plugins/security'
12+
import emoji from 'comark/plugins/emoji'
13+
import toc from 'comark/plugins/toc'
14+
import mermaid from 'comark/plugins/mermaid'
15+
import yaml from 'comark-content/plugins/yaml'
16+
import tracingOtel from 'comark-content/plugins/tracing/otel'
17+
-import { githubLight, githubDark } from 'rangi/themes'
18+
+import vitesseDark from '@shikijs/themes/vitesse-dark'
19+
+import vitesseLight from '@shikijs/themes/vitesse-light'
20+
import { contentTracer } from './tracer.ts'
21+
22+
// Rebuilt only when the head advances (see `getProdContent`). Holds the *promise*, not the instance: the
23+
@@ -18,7 +19,7 @@ let content: Promise<ComarkContent> | undefined
24+
// Bump CONTENT_PARSER_VERSION in `cache.ts` when these plugins or their options change cached output.
25+
const comarkPlugins = [
26+
mermaid({ theme: 'zinc-light', themeDark: 'zinc-dark' }),
27+
- rangi({ theme: { light: githubLight, dark: githubDark } }),
28+
+ shiki({ registerDefaultThemes: false, themes: { light: vitesseLight, dark: vitesseDark } }),
29+
toc({ depth: 3 }),
30+
emoji(),
31+
security({

pnpm-lock.yaml

Lines changed: 5 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,14 @@ overrides:
7272
semver: ^7.8.5
7373
shell-quote: ^1.10.0
7474

75+
update:
76+
ignoreDeps:
77+
- typescript@7
78+
patchedDependencies:
79+
comark-docs@0.0.1: patches/comark-docs@0.0.1.patch
7580
catalogs:
7681
build:
77-
'@nuxt/kit': *nuxt
82+
'@nuxt/kit': ^4.5.2
7883
'@preact/preset-vite': ^2.10.6
7984
'@rsbuild/core': ^2.1.13
8085
'@sveltejs/adapter-node': ^5.3.3
@@ -128,7 +133,6 @@ catalogs:
128133
zigpty: ^0.2.1
129134
zod: ^4.4.3
130135
docs:
131-
'@shikijs/themes': ^4.4.3
132136
comark-docs: github:comarkdown/comark-docs
133137
frontend:
134138
'@antfu/design': ^0.3.4
@@ -141,10 +145,10 @@ catalogs:
141145
'@radix-ui/react-scroll-area': ^1.2.18
142146
'@radix-ui/react-slot': ^1.3.3
143147
'@sveltejs/vite-plugin-svelte': ^7.3.0
144-
'@unocss/postcss': *unocss
145-
'@unocss/preset-icons': *unocss
146-
'@unocss/reset': *unocss
147-
'@vueuse/core': *vueuse
148+
'@unocss/postcss': ^66.7.5
149+
'@unocss/preset-icons': ^66.7.5
150+
'@unocss/reset': ^66.7.5
151+
'@vueuse/core': ^14.4.0
148152
'@xterm/addon-fit': ^0.11.0
149153
'@xterm/xterm': ^6.0.0
150154
axe-core: ^4.13.0
@@ -165,21 +169,21 @@ catalogs:
165169
splitpanes: ^4.1.2
166170
svelte: ^5.56.9
167171
tailwind-merge: ^3.6.0
168-
unocss: *unocss
172+
unocss: ^66.7.5
169173
vite-plugin-css-injected-by-js: ^5.0.2
170174
vue: ^3.5.41
171175
inlined:
172176
'@antfu/utils': ^9.3.0
173177
jora: ^1.0.0-beta.16
174178
ua-parser-modern: ^0.1.1
175179
storybook:
176-
'@storybook/addon-a11y': *storybook
177-
'@storybook/addon-docs': *storybook
178-
'@storybook/react-vite': *storybook
179-
'@storybook/svelte-vite': *storybook
180-
'@storybook/vue3-vite': *storybook
180+
'@storybook/addon-a11y': ^10.5.8
181+
'@storybook/addon-docs': ^10.5.8
182+
'@storybook/react-vite': ^10.5.8
183+
'@storybook/svelte-vite': ^10.5.8
184+
'@storybook/vue3-vite': ^10.5.8
181185
'@vitejs/plugin-react-oxc': ^0.4.3
182-
storybook: *storybook
186+
storybook: ^10.5.8
183187
storybook-solidjs-vite: ^10.6.0
184188
testing:
185189
'@playwright/test': ^1.62.1
@@ -202,6 +206,3 @@ catalogs:
202206
'@types/react': ^19.2.18
203207
'@types/react-dom': ^19.2.4
204208
'@types/ws': ^8.18.1
205-
update:
206-
ignoreDeps:
207-
- typescript@7

0 commit comments

Comments
 (0)