@eox/pages-theme-eox 0.1.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.
Files changed (3) hide show
  1. package/README.md +18 -0
  2. package/package.json +8 -0
  3. package/src/index.js +28 -0
package/README.md ADDED
@@ -0,0 +1,18 @@
1
+ # pages-theme-eox
2
+
3
+ Vitepress theme for EOX branded pages.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ npm install -D @eox/pages-theme-eox
9
+
10
+ // .vitepress/theme/index.js
11
+ import EOX from "@eox/pages-theme-eox"
12
+
13
+ export default {
14
+ extends: EOX
15
+ };
16
+ ```
17
+
18
+ See also the [Vitepress Docs](https://vitepress.dev/guide/custom-theme#consuming-a-custom-theme).
package/package.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "@eox/pages-theme-eox",
3
+ "version": "0.1.0",
4
+ "description": "Vitepress Theme with EOX branding",
5
+ "main": "src/index.js",
6
+ "author": "EOX",
7
+ "license": "MIT"
8
+ }
package/src/index.js ADDED
@@ -0,0 +1,28 @@
1
+ import DefaultTheme from "vitepress/theme";
2
+
3
+ export default {
4
+ extends: DefaultTheme,
5
+ enhanceApp({ siteData }) {
6
+ if (!import.meta.env.SSR) {
7
+ const brandStyle = document.createElement("style");
8
+ brandStyle.appendChild(
9
+ document.createTextNode(`
10
+ :root {
11
+ /* legacy fallback */
12
+ --vp-c-brand: ${siteData.value.themeConfig.theme.primaryColor};
13
+ --vp-c-brand-1: ${siteData.value.themeConfig.theme.primaryColor};
14
+ --vp-c-brand-2: ${siteData.value.themeConfig.theme.primaryColor};
15
+ --vp-c-brand-3: ${siteData.value.themeConfig.theme.primaryColor};
16
+
17
+ /* brand color shadings */
18
+ --vp-c-brand-1: color-mix(in srgb, ${siteData.value.themeConfig.theme.primaryColor} 100%, white);
19
+ --vp-c-brand-2: color-mix(in srgb, ${siteData.value.themeConfig.theme.primaryColor} 90%, white);
20
+ --vp-c-brand-3: color-mix(in srgb, ${siteData.value.themeConfig.theme.primaryColor} 80%, white);
21
+ --vp-c-brand-soft: color-mix(in srgb, ${siteData.value.themeConfig.theme.primaryColor} 16%, transparent);
22
+ }
23
+ `)
24
+ );
25
+ document.head.appendChild(brandStyle);
26
+ }
27
+ },
28
+ };