-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
568c4f7
commit e8258c1
Showing
103 changed files
with
903 additions
and
811 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Theme Guidelines | ||
|
||
To avoid theme developers and users setting unneeded options, we have a set of guidelines that should be followed when creating a theme. | ||
|
||
## DOM Structure | ||
|
||
A theme must implement the following DOM structure: | ||
|
||
- Container: An element which contains the entire theme. This element should have an attribute `vp-container`. | ||
- Content: An element which holds markdown render results. This element should have an attribute `vp-content`. | ||
|
||
A theme may have the following optional elements: | ||
|
||
- Navbar: Navbar of the site. This element should have an attribute `vp-navbar`. | ||
- Sidebar: Sidebar of the site. This element should have an attribute `vp-sidebar`. | ||
- Outline: Headings or outline of the main content. This element should have an attribute `vp-outline`. | ||
- Comment: Comment service (comment box and comment list). This element should have an attribute `vp-comment`. | ||
- Footer: Footer of the site. This element should have an attribute `vp-footer`. | ||
|
||
A theme must: | ||
|
||
- Set `data-theme` to `dark` on html in darkmode. | ||
- Set `data-theme` to `light` on html in lightmode. | ||
|
||
If it only have one color scheme, it still needs to set `data-theme` to `light` or `dark` to indicate the default color scheme. | ||
|
||
## Color Variables | ||
|
||
A theme must implement the following color variables: | ||
|
||
### Text | ||
|
||
- `--vp-c-text`: Default text color. | ||
- `--vp-c-text-mute`: Colors for muted texts, such as "inactive menu" or "info texts". | ||
- `--vp-c-text-subtle`: Color for subtle text, such as as "placeholders" or "caret icon". | ||
|
||
### Background | ||
|
||
- `--vp-c-bg`: The bg color used for main screen. | ||
- `--vp-c-bg-alt`: The alternative bg color used in places such as "sidebar", or "code block". | ||
- `--vp-c-bg-elv`: The elevated bg color. This is used at parts where it "floats", such as "dialog". | ||
|
||
### Shadow | ||
|
||
- `--vp-c-shadow`: The normal shadow color | ||
- `--vp-c-shadow-hard`: The shadow color used for hard shadow, such as "dialog". | ||
|
||
### Accent | ||
|
||
Accent color and brand colors which used for interactive components. | ||
|
||
- `--vp-c-accent`: The most solid color used mainly for colored text. It must satisfy the contrast ratio against when used on top of `--vp-c-accent-soft`. | ||
- `--vp-c-accent-hover`: Color used for hover state. | ||
- `--vp-c-accent-bg`: Color used for solid background. It must satisfy the contrast ratio with `--vp-c-accent-text` on top of it. | ||
- `--vp-c-accent-text`: Color used for text with `--vp-c-accent-bg` background. It must satisfy the contrast ratio with `--vp-c-accent-bg`. | ||
- `--vp-c-accent-soft`: The color used for subtle background such as custom container or badges. It must satisfy the contrast ratio when putting `--vp-c-accent` colors on top of it. | ||
|
||
The soft color must be semi transparent alpha channel. This is crucial because it allows adding multiple "soft" colors on top of each other to create a accent, such as when having inline code block inside custom containers. | ||
|
||
### Borders | ||
|
||
- `--vp-c-border`: Border color for interactive components. For example this should be used for a button outline. | ||
- `--vp-c-border-hard`: Darker border colors, which is used for "hard" borders closed to text, such as table and kbd. | ||
- `--vp-c-divider`: Color for separators, used to divide sections within the same components, such as having separator on "h2" heading. | ||
|
||
### Controls | ||
|
||
- `--vp-c-control`: Background color for interactive controls, such as buttons or checkboxes. | ||
- `--vp-c-control-hover`: Background color for hover state of interactive controls. | ||
- `--vp-c-control-active`: Background color for active or focus state of interactive controls. | ||
- `--vp-c-control-disabled`: Color for disabled state of interactive controls. | ||
|
||
## Transition timing | ||
|
||
- `--vp-t-color`: Color transition timing. | ||
- `--vp-t-transform`: Transform transition timing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# 主题指南 | ||
|
||
为了避免主题开发者和用户设置不必要的选项,我们制定了一套主题创建时应遵循的指南。 | ||
|
||
## DOM 结构 | ||
|
||
一个主题必须实现以下 DOM 结构: | ||
|
||
- 容器:一个包含整个主题的元素。此元素应该有一个 `vp-container` 属性。 | ||
- 内容:一个包含 markdown 渲染结果的元素。此元素应该有一个 `vp-content` 属性。 | ||
|
||
一个主题可以有以下可选元素: | ||
|
||
- 导航栏:站点的导航栏。此元素应该有一个 `vp-navbar` 属性。 | ||
- 侧边栏:站点的侧边栏。此元素应该有一个 `vp-sidebar` 属性。 | ||
- 大纲:主要内容的标题或大纲。此元素应该有一个 `vp-outline` 属性。 | ||
- 评论:评论服务(评论框和评论列表)。此元素应该有一个 `vp-comment` 属性。 | ||
- 页脚:站点的页脚。此元素应该有一个 `vp-footer` 属性。 | ||
|
||
一个主题必须: | ||
|
||
- 在暗色模式下,将 html 元素的 `data-theme` 设置为 `dark`。 | ||
- 在亮色模式下,将 html 元素的 `data-theme` 设置为 `light`。 | ||
|
||
如果主题只有一种颜色方案,主题仍然需要将 `data-theme` 设置为 `light` 或 `dark`,以指示默认颜色方案。 | ||
|
||
## 颜色变量 | ||
|
||
一个主题必须实现以下颜色变量: | ||
|
||
### 文字 | ||
|
||
- `--vp-c-text`:默认文本颜色。 | ||
- `--vp-c-text-mute`:用于静音文本的颜色,例如“非活动菜单”或“信息文本”。 | ||
- `--vp-c-text-subtle`:用于细微文本的颜色,例如“占位符”或“插入符号”。 | ||
|
||
### 背景 | ||
|
||
- `--vp-c-bg`:用于主屏幕的背景颜色。 | ||
- `--vp-c-bg-alt`:用于“侧边栏”或“代码块”等地方的备用背景颜色。 | ||
- `--vp-c-bg-elv`:用于“浮动”部分的提升背景颜色,例如“对话框”。 | ||
|
||
### 阴影 | ||
|
||
- `--vp-c-shadow`:正常阴影颜色 | ||
- `--vp-c-shadow-hard`:用于硬阴影的阴影颜色,例如“对话框”。 | ||
|
||
### 强调 | ||
|
||
用于交互组件的强调颜色和品牌颜色。 | ||
|
||
- `--vp-c-accent`:主要用于彩色文本的最实色。它必须满足与放在 `--vp-c-accent-soft` 顶部时的对比度。 | ||
- `--vp-c-accent-hover`:用于悬停状态的颜色。 | ||
- `--vp-c-accent-bg`:用于实色背景的颜色。它必须满足与放在其顶部的 `--vp-c-accent-text` 的对比度。 | ||
- `--vp-c-accent-text`:用于 `--vp-c-accent-bg` 背景的文本颜色。它必须满足与 `--vp-c-accent-bg` 的对比度。 | ||
- `--vp-c-accent-soft`:用于自定义容器或徽章等细微背景的颜色。当将 `--vp-c-accent` 颜色放在其顶部时,它必须满足对比度。 | ||
|
||
软色必须是半透明的 alpha 通道。这是至关重要的,因为它允许将多个“软”颜色叠加在一起以创建强调,例如在自定义容器内部有内联代码块时。 | ||
|
||
### 边框 | ||
|
||
- `--vp-c-border`:交互组件的边框颜色。例如,这应该用于按钮轮廓。 | ||
- `--vp-c-border-hard`:较暗的边框颜色,用于紧贴文本的“硬”边框,例如表格和 kbd。 | ||
- `--vp-c-divider`:分隔符的颜色,用于在同一组件内分隔部分,例如在“h2”标题上放置分隔符。 | ||
|
||
### 控件 | ||
|
||
- `--vp-c-control`:用于交互控件(例如按钮或复选框)的背景颜色。 | ||
- `--vp-c-control-hover`:用于交互控件悬停状态的背景颜色。 | ||
- `--vp-c-control-active`:用于交互控件的活动或焦点状态的背景颜色。 | ||
- `--vp-c-control-disabled`:用于交互控件禁用状态的颜色。 | ||
|
||
## 过渡时间 | ||
|
||
- `--vp-t-color`:颜色过渡时间。 | ||
- `--vp-t-transform`:变换过渡时间。 |
Oops, something went wrong.