Skip to content

Commit

Permalink
docs: upgrade vitepress
Browse files Browse the repository at this point in the history
  • Loading branch information
liihuu committed Sep 13, 2023
1 parent 9815f21 commit 811100f
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 91 deletions.
5 changes: 2 additions & 3 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export default defineConfig({
{ text: 'Pro', link: 'https://pro.klinecharts.com' },
{ text: '预览', link: 'https://preview.klinecharts.com' },
{ text: '赞助', link: '/sponsor' },
{ text: '找工作', link: 'https://www.bolejobs.co' },
{
text: `V${pkg.version}`,
items: [{ text: 'V8 文档', link: 'https://v8.klinecharts.com/zh-CN' }]
Expand Down Expand Up @@ -121,7 +120,8 @@ export default defineConfig({
lastUpdatedText: '最后更新时间',
sidebarMenuLabel: '菜单',
darkModeSwitchLabel: '主题',
outlineTitle: '本页目录'
outlineTitle: '本页目录',
returnToTopLabel: '返回顶部',
}
},
'en-US': {
Expand All @@ -134,7 +134,6 @@ export default defineConfig({
{ text: 'Pro', link: 'https://pro.klinecharts.com/en-US' },
{ text: 'Preview', link: 'https://preview.klinecharts.com/#en-US' },
{ text: 'Sponsor', link: '/en-US/sponsor' },
{ text: 'Jobs', link: 'https://www.bolejobs.co' },
{
text: `V${pkg.version}`,
items: [{ text: 'V8 Docs', link: 'https://v8.klinecharts.com' }]
Expand Down
108 changes: 24 additions & 84 deletions docs/.vitepress/theme/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,25 @@
* -------------------------------------------------------------------------- */

:root {
--vp-c-brand: #1677FF;
--vp-c-brand-dark: #1677FF;
--vp-c-brand-light: #3086ff;
--vp-c-brand-lighter: #4995ff;
--vp-c-brand-lightest: #afd0ff;
/* --vp-c-brand-dark: #535bf2;
--vp-c-brand-darker: #454ce1; */
--vp-c-brand-dimm: rgba(22, 119, 255, 0.08);
}

/**
* Component: Button
* -------------------------------------------------------------------------- */

:root {
--vp-button-brand-border: var(--vp-c-brand-light);
/* --vp-button-brand-text: var(--vp-c-white); */
--vp-button-brand-bg: var(--vp-c-brand);
--vp-button-brand-hover-border: var(--vp-c-brand-light);
/* --vp-button-brand-hover-text: var(--vp-c-white); */
--vp-button-brand-hover-bg: var(--vp-c-brand-light);
--vp-button-brand-active-border: var(--vp-c-brand-light);
/* --vp-button-brand-active-text: var(--vp-c-white); */
--vp-c-indigo-1: #1677FF;
--vp-c-indigo-2: #3086ff;
--vp-c-indigo-3: #4995ff;
--vp-c-indigo-soft: rgb(22, 119, 255, 0.14);

--vp-code-color: #476582;

--vp-button-brand-border: var(--vp-c-indigo-2);
--vp-button-brand-bg: var(--vp-c-indigo-1);
--vp-button-brand-hover-border: var(--vp-c-indigo-2);
--vp-button-brand-hover-bg: var(--vp-c-indigo-2);
--vp-button-brand-active-border: var(--vp-c-indigo-2);
--vp-button-brand-active-bg: var(--vp-button-brand-bg);
}

/**
* Component: Home
* -------------------------------------------------------------------------- */
--vp-custom-block-font-size: 13px;
--vp-custom-block-code-font-size: 12px;
--vp-code-line-height: 1.6;
--vp-code-font-size: 1em;

:root {
--vp-home-hero-name-color: transparent;
--vp-home-hero-name-background: -webkit-linear-gradient(
145deg,
Expand All @@ -54,6 +42,14 @@
--vp-home-hero-image-filter: blur(40px);
}

.dark {
--vp-code-color: #c9def1;
}

body {
font-size: 14px;
}

@media (min-width: 640px) {
:root {
--vp-home-hero-image-filter: blur(60px);
Expand All @@ -66,62 +62,6 @@
}
}

/**
* Component: Custom Block
* -------------------------------------------------------------------------- */

:root {
--vp-custom-block-tip-border: var(--vp-c-brand);
--vp-custom-block-tip-text: var(--vp-c-brand);
--vp-custom-block-tip-bg: var(--vp-c-brand-dimm);
}

.dark {
--vp-custom-block-tip-border: var(--vp-c-brand);
--vp-custom-block-tip-text: var(--vp-c-brand-lightest);
--vp-custom-block-tip-bg: var(--vp-c-brand-dimm);
}

/**
* Component: Algolia
* -------------------------------------------------------------------------- */

/* .DocSearch {
--docsearch-primary-color: var(--vp-c-brand) !important;
} */

/**
* VitePress: Custom fix
* -------------------------------------------------------------------------- */

/*
Use lighter colors for links in dark mode for a11y.
Also specify some classes twice to have higher specificity
over scoped class data attribute.
*/
/* .dark .vp-doc a,
.dark .vp-doc a > code,
.dark .VPNavBarMenuLink.VPNavBarMenuLink:hover,
.dark .VPNavBarMenuLink.VPNavBarMenuLink.active,
.dark .link.link:hover,
.dark .link.link.active,
.dark .edit-link-button.edit-link-button,
.dark .pager-link .title {
color: var(--vp-c-brand-lighter);
} */

/* .dark .vp-doc a:hover,
.dark .vp-doc a > code:hover {
color: var(--vp-c-brand-lightest);
opacity: 1;
} */

/* Transition by color instead of opacity */
/* .dark .vp-doc .custom-block a {
transition: color 0.25s;
} */


.home-section {
border-top: 1px solid var(--vp-c-gutter);
padding: 60px 24px;
Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/guide/instance-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
```
Get the dom container.
- `paneId` window id, the default is the entire chart container
- `position` options are 'root', 'main' and 'yAxis', default is 'root'
- `position` supports `root`, `main`, `yAxis`, the default is `root`


## getSize(paneId, position)
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/instance-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
```
获取dom容器。
- `paneId` 窗口id,缺省则是整个图表容器
- `position` 可选项为'root','main'和'yAxis',缺省则是'root'
- `position` 支持`root``main``yAxis`,缺省则是`root`


## getSize(paneId, position)
Expand Down
2 changes: 1 addition & 1 deletion docs/sponsor.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar: false

# ❤️ 赞助

如果你觉得插件还不错,希望你能在[GitHub](https://github.com/liihuu/KLineChart)点一个 🌟。如果能够打赏一杯 ☕️,那就真的太感谢了。
如果你觉得插件还不错,希望你能在 [GitHub](https://github.com/liihuu/KLineChart) 点一个 🌟。如果能够打赏一杯 ☕️,那就真的太感谢了。

## 支付宝
<img style="width:180px;margin-top:10px" src="/images/alipay_qr_code.png"/>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@
"rollup-plugin-progress": "^1.1.2",
"tslib": "^2.5.0",
"typescript": "^4.8.3",
"vitepress": "^1.0.0-rc.4"
"vitepress": "^1.0.0-rc.13"
}
}

0 comments on commit 811100f

Please sign in to comment.