@sit-onyx/vitepress-theme 0.0.0 → 0.0.1-alpha.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
@@ -6,9 +6,9 @@
6
6
  </a>
7
7
  </p>
8
8
 
9
- # Onyx VitePress theme
9
+ # onyx VitePress theme
10
10
 
11
- VitePress theme that uses the Onyx design system created by [Schwarz IT](https://it.schwarz).
11
+ VitePress theme that uses the onyx design system created by [Schwarz IT](https://it.schwarz).
12
12
 
13
13
  ## Documentation
14
14
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sit-onyx/vitepress-theme",
3
- "description": "VitePress theme that uses the Onyx design system",
4
- "version": "0.0.0",
3
+ "description": "VitePress theme that uses the onyx design system",
4
+ "version": "0.0.1-alpha.0",
5
5
  "type": "module",
6
6
  "author": "Schwarz IT KG",
7
7
  "license": "Apache-2.0",
@@ -22,7 +22,8 @@
22
22
  },
23
23
  "peerDependencies": {
24
24
  "sass": ">= 1",
25
- "vitepress": ">= 1.0.0-rc.0"
25
+ "vitepress": ">= 1.0.0-rc.0",
26
+ "sit-onyx": "^0.1.0-alpha.2"
26
27
  },
27
28
  "scripts": {
28
29
  "build": "tsc --noEmit"
package/src/index.scss CHANGED
@@ -1,61 +1,60 @@
1
- @use "../../sit-onyx/src/styles/index.scss";
1
+ @use "sit-onyx/src/styles/index.scss";
2
2
  @use "mixins.scss";
3
3
 
4
- // override default VitePress CSS variables to apply Onyx theming
4
+ // override default VitePress CSS variables to apply onyx theming
5
5
  // see: https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/vars.css#L178
6
6
  :root {
7
7
  // color palette
8
- @include mixins.define-vitepress-color(brand, --onyx-color-brand-primary);
9
- @include mixins.define-vitepress-color(tip, --onyx-color-surface-info);
10
- @include mixins.define-vitepress-color(warning, --onyx-color-surface-warning);
11
- @include mixins.define-vitepress-color(danger, --onyx-color-surface-danger);
12
- @include mixins.define-vitepress-color(default, --onyx-color-surface-brand-neutral, -200);
8
+ @include mixins.define-vitepress-color(brand, --onyx-color-base-brand);
9
+ @include mixins.define-vitepress-color(tip, --onyx-color-base-info);
10
+ @include mixins.define-vitepress-color(warning, --onyx-color-base-warning);
11
+ @include mixins.define-vitepress-color(danger, --onyx-color-base-danger);
12
+ @include mixins.define-vitepress-color(default, --onyx-color-base-neutral, -200);
13
13
 
14
14
  // background
15
- --vp-c-bg: var(--onyx-color-surface-bg-tinted);
16
- --vp-c-bg-alt: var(--onyx-color-surface-bg-blank);
17
- --vp-c-bg-elv: var(--onyx-color-surface-bg-tinted);
18
- --vp-c-bg-soft: var(--onyx-color-surface-bg-blank);
15
+ --vp-c-bg: var(--onyx-color-base-background-tinted);
16
+ --vp-c-bg-alt: var(--onyx-color-base-background-blank);
17
+ --vp-c-bg-elv: var(--onyx-color-base-background-tinted);
18
+ --vp-c-bg-soft: var(--onyx-color-base-background-blank);
19
19
 
20
20
  // borders
21
21
  // used for separators (e.g. below h2 headline)
22
- --vp-c-border: var(--onyx-color-border-brand-neutral-300);
22
+ --vp-c-border: var(--onyx-color-base-neutral-300);
23
23
  // border on interactive components (e.g. button outline)
24
- --vp-c-divider: var(--onyx-color-border-brand-neutral-200);
24
+ --vp-c-divider: var(--onyx-color-base-neutral-200);
25
25
  // divide components in the page (e.g. header and page content)
26
- --vp-c-gutter: var(--onyx-color-border-brand-neutral-200);
26
+ --vp-c-gutter: var(--onyx-color-base-neutral-200);
27
27
 
28
28
  // typography
29
- --vp-c-text-1: var(--onyx-color-text-body-paragraph-intense); // regular text
30
- --vp-c-text-2: var(--onyx-color-text-body-paragraph-medium); // muted text (e.g. inactive menu)
31
- --vp-c-text-3: var(--onyx-color-text-body-paragraph-soft); // subtle text (e.g. placeholders)
29
+ --vp-c-text-1: var(--onyx-color-text-neutral-intense); // regular text
30
+ --vp-c-text-2: var(--onyx-color-text-neutral-medium); // muted text (e.g. inactive menu)
31
+ --vp-c-text-3: var(--onyx-color-text-neutral-soft); // subtle text (e.g. placeholders)
32
32
  --vp-font-family-base: var(--onyx-font-family);
33
33
  --vp-font-family-mono: var(--onyx-font-family-mono);
34
+ --vp-code-color: var(--vp-c-brand-2);
34
35
 
35
36
  @include mixins.home-page-gradients(
36
- var(--onyx-color-brand-primary-500),
37
- var(--onyx-color-text-info-500)
37
+ var(--onyx-color-base-brand-500),
38
+ var(--onyx-color-base-info-500)
38
39
  );
39
-
40
- // remove the following lines when this VitePress PR is merged:
41
- // https://github.com/vuejs/vitepress/pull/3434
42
- --vp-badge-tip-text: var(--vp-c-tip-1);
43
- --vp-badge-tip-bg: var(--vp-c-tip-soft);
44
- --vp-custom-block-tip-bg: var(--vp-c-tip-soft);
45
- --vp-custom-block-tip-code-bg: var(--vp-c-tip-soft);
46
- --vp-code-line-warning-color: var(--vp-c-warning-soft);
47
- --vp-code-line-error-color: var(--vp-c-danger-soft);
48
40
  }
49
41
 
50
42
  .dark {
51
43
  // use lighter neutral color in dark mode since its too dark otherwise
52
- @include mixins.define-vitepress-color(default, --onyx-color-surface-brand-neutral, 200);
44
+ @include mixins.define-vitepress-color(default, --onyx-color-base-neutral, 200);
53
45
 
54
46
  // VitePress shows a fully white background when hovering in dark mode
55
47
  // which is really flashy so we use a more subtle color
56
48
  .vp-sponsor-grid-item {
57
49
  &:hover {
58
- background-color: var(--onyx-color-border-brand-neutral-200);
50
+ background-color: var(--onyx-color-base-neutral-200);
59
51
  }
60
52
  }
61
53
  }
54
+
55
+ .custom-block.tip a,
56
+ .custom-block.tip code {
57
+ // use a higher contrast color for links/code inside tip blocks
58
+ // because the default contrast is too low
59
+ color: var(--onyx-color-text-info-bold);
60
+ }
package/src/mixins.scss CHANGED
@@ -7,7 +7,7 @@
7
7
  }
8
8
 
9
9
  /**
10
- * Defines the 4 scaled VitePress color CSS variables for the given Onyx variable name.
10
+ * Defines the 4 scaled VitePress color CSS variables for the given onyx variable name.
11
11
  *
12
12
  * @example
13
13
  * $name: "brand" , $onyx-color-base: "--onyx-test"