forked from vuepress-reco/vuepress-theme-reco
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow customize the primary color
- Loading branch information
Showing
6 changed files
with
130 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,37 @@ | ||
export const series = { | ||
// todo README.md 无法展示,没有对 '' 进行处理 | ||
'/en/docs/guide/': ['introduce', 'getting-started', 'style', 'contribute', 'folder-specification'], | ||
'/en/docs/guide/': [ | ||
'introduce', | ||
'getting-started', | ||
'style', | ||
'contribute', | ||
'folder-specification', | ||
], | ||
'/en/docs/theme/': [ | ||
{ | ||
text: 'Basic', | ||
children: ['introduce', 'usage', 'custom-catalog-title'] | ||
children: [ | ||
'introduce', | ||
'usage', | ||
'custom-catalog-title', | ||
'custom-primary-color', | ||
], | ||
}, | ||
{ | ||
text: 'Advance', | ||
children: ['home', 'series', 'comments', 'auto-set-category', 'custom-container', 'custom-style', 'code-import', 'bulletin-popover', 'register-components', 'password'] | ||
} | ||
children: [ | ||
'home', | ||
'series', | ||
'comments', | ||
'auto-set-category', | ||
'custom-container', | ||
'custom-style', | ||
'code-import', | ||
'bulletin-popover', | ||
'register-components', | ||
'password', | ||
], | ||
}, | ||
], | ||
'/en/docs/plugins/': ['page', 'comments', 'vue-previews', 'bulletin-popover'], | ||
} |
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 |
---|---|---|
@@ -1,15 +1,37 @@ | ||
export const series = { | ||
// todo README.md 无法展示,没有对 '' 进行处理 | ||
'/docs/guide/': ['introduce', 'getting-started', 'style', 'contribute', 'folder-specification'], | ||
'/docs/guide/': [ | ||
'introduce', | ||
'getting-started', | ||
'style', | ||
'contribute', | ||
'folder-specification', | ||
], | ||
'/docs/theme/': [ | ||
{ | ||
text: '基础', | ||
children: ['introduce', 'usage', 'custom-catalog-title'] | ||
children: [ | ||
'introduce', | ||
'usage', | ||
'custom-catalog-title', | ||
'custom-primary-color', | ||
], | ||
}, | ||
{ | ||
text: '高级', | ||
children: ['home', 'series', 'comments', 'auto-set-category', 'custom-container', 'custom-style', 'code-import', 'bulletin-popover', 'register-components', 'password'] | ||
} | ||
children: [ | ||
'home', | ||
'series', | ||
'comments', | ||
'auto-set-category', | ||
'custom-container', | ||
'custom-style', | ||
'code-import', | ||
'bulletin-popover', | ||
'register-components', | ||
'password', | ||
], | ||
}, | ||
], | ||
'/docs/plugins/': ['page', 'comments', 'vue-previews', 'bulletin-popover'], | ||
} |
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,21 @@ | ||
--- | ||
title: 自定义主题的基础色 | ||
date: 2023-01-21 01:00:00 | ||
--- | ||
|
||
::: warning | ||
主题是通过 `tailwindcss` 来配置 css 的,后期可能会开放更多的配置能力,所以当前功能的 API 在以后可能会改变。 | ||
::: | ||
|
||
如果你对主题的默认的主色不喜欢,可以通过 `themeConfig.primaryColor` 来自定义,主题会修改 `tailwindcss` 的配置: | ||
|
||
```ts | ||
import { defineUserConfig } from 'vuepress' | ||
import { recoTheme } from 'vuepress-theme-reco' | ||
|
||
export default defineUserConfig({ | ||
theme: recoTheme({ | ||
primaryColor: '#3aa675' | ||
}) | ||
}) | ||
``` |
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,21 @@ | ||
--- | ||
title: Customize the primary color | ||
date: 2023-01-21 01:00:00 | ||
--- | ||
|
||
::: warning | ||
The theme configures css through `tailwindcss`, more configuration capabilities may be opened later, so the API of the current functionality may change later. | ||
::: | ||
|
||
If you don't like the theme's default primary color, you can customize it by `themeConfig.primaryColor` : | ||
|
||
```ts | ||
import { defineUserConfig } from 'vuepress' | ||
import { recoTheme } from 'vuepress-theme-reco' | ||
|
||
export default defineUserConfig({ | ||
theme: recoTheme({ | ||
primaryColor: '#3aa675' | ||
}) | ||
}) | ||
``` |
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