@sit-onyx/vitepress-theme 0.0.0 → 0.1.0-alpha.1
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 +2 -2
- package/package.json +6 -4
- package/src/index.scss +29 -30
- package/src/mixins.scss +27 -3
package/README.md
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
</a>
|
|
7
7
|
</p>
|
|
8
8
|
|
|
9
|
-
#
|
|
9
|
+
# onyx VitePress theme
|
|
10
10
|
|
|
11
|
-
VitePress theme that uses the
|
|
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
|
|
4
|
-
"version": "0.0.
|
|
3
|
+
"description": "VitePress theme that uses the onyx design system",
|
|
4
|
+
"version": "0.1.0-alpha.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Schwarz IT KG",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"src"
|
|
10
10
|
],
|
|
11
11
|
"exports": {
|
|
12
|
-
".": "./src/index.ts"
|
|
12
|
+
".": "./src/index.ts",
|
|
13
|
+
"./mixins.scss": "./src/mixins.scss"
|
|
13
14
|
},
|
|
14
15
|
"homepage": "https://onyx.schwarz/packages/vitepress-theme.html",
|
|
15
16
|
"repository": {
|
|
@@ -22,7 +23,8 @@
|
|
|
22
23
|
},
|
|
23
24
|
"peerDependencies": {
|
|
24
25
|
"sass": ">= 1",
|
|
25
|
-
"vitepress": ">= 1.0.0-rc.0"
|
|
26
|
+
"vitepress": ">= 1.0.0-rc.0",
|
|
27
|
+
"sit-onyx": "^0.1.0-alpha.2"
|
|
26
28
|
},
|
|
27
29
|
"scripts": {
|
|
28
30
|
"build": "tsc --noEmit"
|
package/src/index.scss
CHANGED
|
@@ -1,61 +1,60 @@
|
|
|
1
|
-
@use "
|
|
1
|
+
@use "sit-onyx/src/styles/index.scss";
|
|
2
2
|
@use "mixins.scss";
|
|
3
3
|
|
|
4
|
-
// override default VitePress CSS variables to apply
|
|
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
|
|
9
|
-
@include mixins.define-vitepress-color(tip, --onyx-color-
|
|
10
|
-
@include mixins.define-vitepress-color(warning, --onyx-color-
|
|
11
|
-
@include mixins.define-vitepress-color(danger, --onyx-color-
|
|
12
|
-
@include mixins.define-vitepress-color(default, --onyx-color-
|
|
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-
|
|
16
|
-
--vp-c-bg-alt: var(--onyx-color-
|
|
17
|
-
--vp-c-bg-elv: var(--onyx-color-
|
|
18
|
-
--vp-c-bg-soft: var(--onyx-color-
|
|
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-
|
|
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-
|
|
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-
|
|
26
|
+
--vp-c-gutter: var(--onyx-color-base-neutral-200);
|
|
27
27
|
|
|
28
28
|
// typography
|
|
29
|
-
--vp-c-text-1: var(--onyx-color-text-
|
|
30
|
-
--vp-c-text-2: var(--onyx-color-text-
|
|
31
|
-
--vp-c-text-3: var(--onyx-color-text-
|
|
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-
|
|
37
|
-
var(--onyx-color-
|
|
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-
|
|
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-
|
|
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
|
|
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"
|
|
@@ -43,11 +43,35 @@
|
|
|
43
43
|
);
|
|
44
44
|
--vp-home-hero-image-filter: blur(44px);
|
|
45
45
|
|
|
46
|
-
@
|
|
46
|
+
@include breakpoint(min, l) {
|
|
47
47
|
--vp-home-hero-image-filter: blur(68px);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
@
|
|
50
|
+
@include breakpoint(min, s) {
|
|
51
51
|
--vp-home-hero-image-filter: blur(56px);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Applies CSS only to the given VitePress breakpoint.
|
|
57
|
+
* @param {string} $min-max - Whether the breakpoint should be considered as min or max width.
|
|
58
|
+
* @param {string} $name - name of the VitePress breakpoint. One of: xs, s, m, l, xl or xxl
|
|
59
|
+
* @param {number} $offset - optional offset to add to the min/max width. Useful if both min and max are used for the same breakpoint
|
|
60
|
+
*
|
|
61
|
+
* @example breakpoint(min, m)
|
|
62
|
+
* @example breakpoint(max, m)
|
|
63
|
+
*/
|
|
64
|
+
@mixin breakpoint($min-max, $name, $offset: 0) {
|
|
65
|
+
$breakpoints: (
|
|
66
|
+
xs: 375px,
|
|
67
|
+
s: 640px,
|
|
68
|
+
m: 768px,
|
|
69
|
+
l: 960px,
|
|
70
|
+
xl: 1280px,
|
|
71
|
+
xxl: 1440px,
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
@media (#{$min-max}-width: #{map-get($breakpoints, $name) + $offset}) {
|
|
75
|
+
@content;
|
|
76
|
+
}
|
|
77
|
+
}
|