@voidzero-dev/vitepress-theme 3.3.0 → 4.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/README.md CHANGED
@@ -45,9 +45,33 @@ In your `.vitepress/theme/index.ts`:
45
45
  ```ts
46
46
  import type { Theme } from 'vitepress'
47
47
  import Theme from '@voidzero-dev/vitepress-theme'
48
+ import './styles.css'
48
49
 
49
50
  export default {
50
51
  extends: BaseTheme as unknown as Theme,
51
52
  Layout
52
53
  } satisfies Theme
53
54
  ```
55
+
56
+ In the CSS, import the CSS from theme (which imports tailwind):
57
+
58
+ ```css
59
+ /* styles.css */
60
+ @import "@voidzero-dev/vitepress-theme/src/styles/index.css";
61
+
62
+ @source "./**/*.vue";
63
+
64
+ /* Project specific branding colors */
65
+ :root[data-variant="vite"] {
66
+ --color-brand: #6B1EB9;
67
+ }
68
+
69
+ :root.dark:not([data-theme])[data-variant="vite"],
70
+ :root[data-theme="dark"][data-variant="vite"] {
71
+ --color-brand: var(--color-vite);
72
+ }
73
+
74
+ :root[data-theme="light"][data-variant="vite"] {
75
+ --color-brand: #6B1EB9;
76
+ }
77
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voidzero-dev/vitepress-theme",
3
- "version": "3.3.0",
3
+ "version": "4.0.0",
4
4
  "description": "Shared VitePress theme for VoidZero projects",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -25,6 +25,13 @@ defineOptions({ inheritAttrs: false })
25
25
  <VPLink
26
26
  v-bind="$attrs"
27
27
  class="flex items-center justify-between rounded-md px-3 py-2 text-sm font-heading text-primary dark:text-white text-left whitespace-nowrap hover:opacity-70 transition-opacity"
28
+ :class="{
29
+ active: isActive(
30
+ page.relativePath,
31
+ item.activeMatch || href,
32
+ !!item.activeMatch
33
+ )
34
+ }"
28
35
  :href
29
36
  :target="item.target"
30
37
  :rel="item.rel"
@@ -42,4 +49,13 @@ defineOptions({ inheritAttrs: false })
42
49
  border-top: 1px solid var(--vp-c-divider);
43
50
  padding: 12px 12px 0;
44
51
  }
52
+
53
+ .link:hover {
54
+ color: var(--vp-c-brand-1);
55
+ background-color: var(--vp-c-default-soft);
56
+ }
57
+
58
+ .link.active {
59
+ color: var(--vp-c-brand-1);
60
+ }
45
61
  </style>
@@ -20,13 +20,25 @@ const href = computed(() =>
20
20
 
21
21
  <template>
22
22
  <VPLink
23
- class="flex items-center px-3 py-2 text-base font-heading text-primary dark:text-white hover:opacity-70 transition-opacity whitespace-nowrap overflow-hidden text-ellipsis"
24
- :href
25
- :target="item.target"
26
- :rel="item.rel"
27
- :no-icon="item.noIcon"
28
- tabindex="0"
29
- >
23
+ class="flex items-center px-3 py-2 text-base font-heading text-primary
24
+ dark:text-white hover:opacity-85 transition-opacity whitespace-nowrap overflow-hidden text-ellipsis"
25
+ :class="{
26
+ active: isActive(
27
+ page.relativePath,
28
+ item.activeMatch || href,
29
+ !!item.activeMatch
30
+ )
31
+ }" :href :target="item.target" :rel="item.rel" :no-icon="item.noIcon" tabindex="0">
30
32
  <span v-html="item.text"></span>
31
33
  </VPLink>
32
34
  </template>
35
+
36
+ <style scoped>
37
+ .link.active {
38
+ color: var(--vp-c-brand-1);
39
+ }
40
+
41
+ .link:hover {
42
+ color: var(--vp-c-brand-1);
43
+ }
44
+ </style>
package/src/index.ts CHANGED
@@ -15,8 +15,6 @@
15
15
 
16
16
  // Unified design system - single import
17
17
  // Contains: tokens → base → docs → marketing (in that order)
18
- import "./styles/index.css";
19
-
20
18
  import type { Theme } from "vitepress";
21
19
  import { watch } from "vue";
22
20
 
@@ -49,35 +49,6 @@
49
49
  --color-brand: var(--color-electric);
50
50
  }
51
51
 
52
- /* Vite */
53
- :root[data-variant="vite"] {
54
- --color-brand: #6B1EB9;
55
- }
56
-
57
- :root.dark:not([data-theme])[data-variant="vite"],
58
- :root[data-theme="dark"][data-variant="vite"] {
59
- --color-brand: var(--color-vite);
60
- }
61
-
62
- /* Forced light mode brand for Vite */
63
- :root[data-theme="light"][data-variant="vite"] {
64
- --color-brand: #6B1EB9;
65
- }
66
-
67
- /* Vitest */
68
- :root[data-variant="vitest"] {
69
- --color-brand: #008039;
70
- }
71
-
72
- :root.dark:not([data-theme])[data-variant="vitest"],
73
- :root[data-theme="dark"][data-variant="vitest"] {
74
- --color-brand: var(--color-zest);
75
- }
76
-
77
- :root[data-theme="light"][data-variant="vitest"] {
78
- --color-brand: #008039;
79
- }
80
-
81
52
  /* Rolldown */
82
53
  :root[data-variant="rolldown"] {
83
54
  --color-brand: #D44803;
@@ -91,17 +62,3 @@
91
62
  :root[data-theme="light"][data-variant="rolldown"] {
92
63
  --color-brand: #D44803;
93
64
  }
94
-
95
- /* OXC */
96
- :root[data-variant="oxc"] {
97
- --color-brand: #0D6A73;
98
- }
99
-
100
- :root.dark:not([data-theme])[data-variant="oxc"],
101
- :root[data-theme="dark"][data-variant="oxc"] {
102
- --color-brand: var(--color-aqua);
103
- }
104
-
105
- :root[data-theme="light"][data-variant="oxc"] {
106
- --color-brand: #0D6A73;
107
- }