@btravstack/theme 1.0.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/dist/fonts.css ADDED
@@ -0,0 +1,6 @@
1
+ /*
2
+ * btravstack web fonts. Montserrat (display/UI) + JetBrains Mono (code).
3
+ * Loaded from Google Fonts so the system stays zero-asset and portable;
4
+ * the weights here match the --fw-* tokens in tokens.css.
5
+ */
6
+ @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');
@@ -0,0 +1,14 @@
1
+ import { Theme } from "vitepress";
2
+
3
+ //#region src/index.d.ts
4
+ /**
5
+ * The shared btravstack VitePress theme: VitePress's default theme with the
6
+ * btravstack design tokens layered on top. Use it from a site's
7
+ * `.vitepress/theme/index.ts`:
8
+ *
9
+ * import Theme from "@btravstack/theme";
10
+ * export default Theme;
11
+ */
12
+ declare const theme: Theme;
13
+ //#endregion
14
+ export { theme as default };
package/dist/index.mjs ADDED
@@ -0,0 +1,14 @@
1
+ import DefaultTheme from "vitepress/theme";
2
+ import "./style.css";
3
+ //#region src/index.ts
4
+ /**
5
+ * The shared btravstack VitePress theme: VitePress's default theme with the
6
+ * btravstack design tokens layered on top. Use it from a site's
7
+ * `.vitepress/theme/index.ts`:
8
+ *
9
+ * import Theme from "@btravstack/theme";
10
+ * export default Theme;
11
+ */
12
+ const theme = { extends: DefaultTheme };
13
+ //#endregion
14
+ export { theme as default };
package/dist/style.css ADDED
@@ -0,0 +1,82 @@
1
+ /*
2
+ * @btravstack/theme — VitePress style entry.
3
+ *
4
+ * Maps the btravstack design tokens onto VitePress's own `--vp-*` theme
5
+ * variables so every btravstack site (this website + the docs sites) shares
6
+ * one look. Pulled in automatically by the theme's index.ts; consumers can
7
+ * also import it directly as `@btravstack/theme/style.css`.
8
+ *
9
+ * Theming covers BOTH color schemes, so it's safe to let VitePress follow
10
+ * the visitor's OS preference (its default, `appearance: true`):
11
+ * - dark → adopts the btravstack surface palette
12
+ * - light → keeps VitePress's light surfaces, with the brand darkened to
13
+ * the deep beetroot so links/headings pass WCAG-AA on white.
14
+ */
15
+ @import "./fonts.css";
16
+ @import "./tokens.css";
17
+
18
+ /* ── Brand defaults + typography (both schemes) ────────────────── */
19
+ /* `:root:root` / `:root.dark` raise specificity to (0,2,0) so these win
20
+ over VitePress's own `:root` / `.dark` defaults regardless of the order
21
+ the remote @import lands in the cascade. */
22
+ :root:root {
23
+ --vp-c-brand-1: var(--accent);
24
+ --vp-c-brand-2: var(--bt-magenta);
25
+ --vp-c-brand-3: var(--accent-deep);
26
+ --vp-c-brand-soft: rgba(var(--accent-rgb), 0.14);
27
+ --vp-c-brand: var(--accent); /* legacy alias */
28
+
29
+ --vp-font-family-base: var(--sans);
30
+ --vp-font-family-mono: var(--mono);
31
+
32
+ /* Solid brand buttons — dark ink on the pink fill, readable in both schemes */
33
+ --vp-button-brand-bg: var(--accent);
34
+ --vp-button-brand-text: var(--accent-contrast);
35
+ --vp-button-brand-border: transparent;
36
+ --vp-button-brand-hover-bg: var(--bt-magenta);
37
+ --vp-button-brand-hover-text: var(--accent-contrast);
38
+ --vp-button-brand-hover-border: transparent;
39
+ --vp-button-brand-active-bg: var(--accent-deep);
40
+ --vp-button-brand-active-text: var(--bt-cream);
41
+ --vp-button-brand-active-border: transparent;
42
+
43
+ /* Home hero: gradient name + beetroot glow behind the logo */
44
+ --vp-home-hero-name-color: transparent;
45
+ --vp-home-hero-name-background: linear-gradient(120deg, var(--accent), var(--bt-pink-soft));
46
+ --vp-home-hero-image-background-image: radial-gradient(closest-side, rgba(var(--accent-rgb), 0.30), transparent 72%);
47
+ --vp-home-hero-image-filter: blur(8px);
48
+ }
49
+
50
+ /* ── Light scheme: darken the brand so it passes WCAG-AA on white ── */
51
+ :root:not(.dark) {
52
+ --vp-c-brand-1: var(--accent-deep); /* link / active text — ~7:1 on white */
53
+ --vp-c-brand-2: var(--bt-deep-2); /* hover, a touch darker */
54
+ --vp-c-brand-3: var(--accent-deep);
55
+ --vp-c-brand-soft: rgba(var(--accent-rgb), 0.10);
56
+ /* deeper gradient so the hero name reads on a light background */
57
+ --vp-home-hero-name-background: linear-gradient(120deg, var(--accent-deep), var(--bt-magenta));
58
+ }
59
+
60
+ /* ── Dark scheme: btravstack surfaces (matches the landing page) ── */
61
+ :root.dark {
62
+ --vp-c-bg: var(--bg);
63
+ --vp-c-bg-alt: var(--card);
64
+ --vp-c-bg-soft: var(--card-soft);
65
+ --vp-c-bg-elv: var(--card);
66
+
67
+ --vp-c-text-1: var(--text);
68
+ --vp-c-text-2: var(--muted);
69
+ --vp-c-text-3: var(--faint);
70
+
71
+ --vp-c-divider: var(--border);
72
+ --vp-c-border: var(--border-2);
73
+ --vp-c-gutter: var(--border);
74
+
75
+ --vp-c-brand-1: var(--accent); /* pink reads great on dark */
76
+ --vp-c-brand-2: var(--bt-pink-soft);
77
+ --vp-c-brand-soft: rgba(var(--accent-rgb), 0.16);
78
+
79
+ /* Inline + block code */
80
+ --vp-code-color: var(--bt-pink-soft);
81
+ --vp-code-bg: rgba(0, 0, 0, 0.35);
82
+ }
@@ -0,0 +1,81 @@
1
+ /*
2
+ * btravstack design tokens — the single source of truth.
3
+ * Every surface (this landing page + the VitePress docs sites) derives
4
+ * its look from these CSS custom properties. Change a value here, bump
5
+ * the version, and every consumer updates.
6
+ *
7
+ * Naming: semantic tokens (--bg, --text, --accent) are what you should
8
+ * reference in app code. The raw --bt-* brand palette underneath them is
9
+ * the provenance, exposed so adapters (e.g. VitePress) can remap freely.
10
+ */
11
+ :root {
12
+ /* ── Brand palette (raw beetroot) ─────────────────────────────── */
13
+ --bt-pink: #E0589A; /* beetroot flesh — primary accent */
14
+ --bt-pink-soft: #EE9CC4; /* highlight veins */
15
+ --bt-magenta: #CE3D80; /* mid root */
16
+ --bt-deep: #8E1A52; /* dark root */
17
+ --bt-deep-2: #7A1646; /* root tail */
18
+ --bt-leaf: #3DAE62; /* center leaf */
19
+ --bt-leaf-dark: #2C8B4E; /* side leaves */
20
+ --bt-green: #46B86C; /* "success" green (checks) */
21
+ --bt-cream: #F5EFF3; /* near-white text */
22
+ --bt-ink: #1a0c14; /* near-black, for text on accent */
23
+
24
+ /* ── Surfaces ─────────────────────────────────────────────────── */
25
+ --bg: #15101c;
26
+ --bg-grad: #1b1326; /* radial hero glow inner stop */
27
+ --card: #1d1726;
28
+ --card-soft: #241c31;
29
+
30
+ /* ── Borders / dividers ──────────────────────────────────────── */
31
+ --border: rgba(255, 255, 255, 0.08);
32
+ --border-2: rgba(255, 255, 255, 0.12);
33
+
34
+ /* ── Text ────────────────────────────────────────────────────── */
35
+ --text: #F5EFF3;
36
+ --muted: #AEA1BC;
37
+ --faint: #7E7290;
38
+
39
+ /* ── Accent (semantic alias of the brand pink) ───────────────── */
40
+ --accent: #E0589A;
41
+ --accent-deep: #8E1A52;
42
+ --accent-contrast:#1a0c14; /* readable text on an accent fill */
43
+ --accent-rgb: 224, 88, 154; /* for rgba(var(--accent-rgb), .3) */
44
+ --green: #46B86C;
45
+
46
+ /* ── Typography ──────────────────────────────────────────────── */
47
+ --sans: 'Montserrat', 'Segoe UI', system-ui, sans-serif;
48
+ --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
49
+ --fw-medium: 500;
50
+ --fw-semibold: 600;
51
+ --fw-bold: 700;
52
+ --fw-extrabold:800;
53
+
54
+ /* ── Radii ───────────────────────────────────────────────────── */
55
+ --radius-sm: 9px;
56
+ --radius: 12px;
57
+ --radius-lg: 16px;
58
+ --radius-xl: 20px;
59
+ --radius-2xl: 24px;
60
+ --radius-pill: 999px;
61
+
62
+ /* ── Spacing scale ───────────────────────────────────────────── */
63
+ --space-1: 6px;
64
+ --space-2: 9px;
65
+ --space-3: 14px;
66
+ --space-4: 18px;
67
+ --space-5: 22px;
68
+ --space-6: 28px;
69
+
70
+ /* ── Shadows ─────────────────────────────────────────────────── */
71
+ --shadow-card: 0 24px 60px -28px rgba(0, 0, 0, 0.8);
72
+ --shadow-accent: 0 12px 30px -10px rgba(224, 88, 154, 0.6);
73
+ --shadow-toast: 0 18px 40px -16px rgba(0, 0, 0, 0.8);
74
+
75
+ /* ── Layout ──────────────────────────────────────────────────── */
76
+ --container: 1180px;
77
+
78
+ /* ── Motion ──────────────────────────────────────────────────── */
79
+ --speed-fast: 0.15s;
80
+ --speed: 0.2s;
81
+ }
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@btravstack/theme",
3
+ "version": "1.0.0",
4
+ "description": "Shared VitePress theme and design tokens for btravstack sites",
5
+ "license": "MIT",
6
+ "author": "Benoit TRAVERS",
7
+ "type": "module",
8
+ "homepage": "https://btravstack.github.io",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/btravstack/btravstack.github.io.git",
12
+ "directory": "packages/theme"
13
+ },
14
+ "files": ["dist"],
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.mts",
18
+ "import": "./dist/index.mjs"
19
+ },
20
+ "./style.css": "./dist/style.css",
21
+ "./tokens.css": "./dist/tokens.css"
22
+ },
23
+ "sideEffects": ["**/*.css"],
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "scripts": {
28
+ "build": "tsdown && cp src/*.css dist/",
29
+ "dev": "tsdown --watch",
30
+ "prepack": "pnpm run build"
31
+ },
32
+ "peerDependencies": {
33
+ "vitepress": "^1.6.0"
34
+ },
35
+ "devDependencies": {
36
+ "@types/node": "catalog:",
37
+ "tsdown": "catalog:",
38
+ "typescript": "catalog:",
39
+ "vitepress": "catalog:"
40
+ }
41
+ }