Skip to content

Commit f8a39e5

Browse files
committed
Use site theme tokens for llm-pricing chart and list it in the blog sidebar
- Map the llm-pricing style.css custom properties onto the site's VitePress --vp-c-* tokens so the chart inherits the same light/dark palette as the rest of the page (accent = brand, muted = text-3, border = divider, etc.) instead of its own hardcoded colors. - Add a hand-written 'Tools' section to the blog sidebar with an LLM Pricing entry, mirroring the 'Tools' card already on the blog index.
1 parent e648502 commit f8a39e5

2 files changed

Lines changed: 26 additions & 13 deletions

File tree

‎src/components/VPSidebar.astro‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,21 @@ const postSections: SidebarSection[] = POST_SECTIONS.map((section) => ({
5959
})),
6060
}));
6161
62+
// Hand-written "Tools" section — LLM Pricing is a real Astro page, not a
63+
// markdown post in POST_SECTIONS, so it's listed here directly (mirrors the
64+
// hand-written "Tools" card on the blog index).
65+
postSections.push({
66+
title: 'Tools',
67+
items: [
68+
{
69+
text: 'LLM Pricing',
70+
href: `${BASE}blog/llm-pricing/`,
71+
icon: 'toolbox',
72+
isActive: isPathActive(`${BASE}blog/llm-pricing/`),
73+
},
74+
],
75+
});
76+
6277
const mapItems: SidebarItem[] = [
6378
{ text: 'Open Dashboard', href: `${BASE}map/`, icon: 'map', isActive: isPathActive(`${BASE}map/`) },
6479
{ text: 'Classic View', href: `${BASE}map/?view=classic`, icon: 'map', isActive: false },

‎src/features/llm-pricing/style.css‎

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
1+
/* Reuse the site's VitePress theme tokens (defined in
2+
public/styles/vitepress-base.css) so this chart inherits the same light/dark
3+
palette as the rest of the page, rather than its own hardcoded colors. */
14
:root {
2-
--bg: #fff;
5+
--bg: var(--vp-c-bg);
36
--bg-rgb: 255, 255, 255;
4-
--fg: #212529;
5-
--border: #ced4da;
6-
--border-rgb: 206, 212, 218;
7-
--muted: #6c757d;
8-
--accent: #06b6d4;
7+
--fg: var(--vp-c-text-1);
8+
--border: var(--vp-c-divider);
9+
--border-rgb: 223, 227, 232;
10+
--muted: var(--vp-c-text-3);
11+
--accent: var(--vp-c-brand-1);
912
--radius: 6px;
1013
}
1114

1215
html[data-theme='dark'] {
13-
--bg: #1a1a2e;
14-
--bg-rgb: 26, 26, 46;
15-
--fg: #f8f9fa;
16-
--border: #495057;
17-
--border-rgb: 73, 80, 87;
18-
--muted: #adb5bd;
19-
--accent: #22d3ee;
16+
--bg-rgb: 17, 22, 29;
17+
--border-rgb: 43, 52, 64;
2018
}
2119

2220
/* Scoped to this feature's own root — the bare `*`/`html, body` resets the

0 commit comments

Comments
 (0)