mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-15 11:12:54 +02:00
chore: add auto option for theme colors
This commit is contained in:
parent
88a3a9f46b
commit
21ae80e27d
4 changed files with 6 additions and 7 deletions
|
@ -25,7 +25,7 @@ site: {
|
|||
// site description
|
||||
description: 'Retypeset is a static blog theme...'
|
||||
// use i18n title/subtitle/description from src/i18n/ui.ts instead of static ones above
|
||||
i18nTitle: true // light, dark, auto
|
||||
i18nTitle: true // true, false
|
||||
// author name
|
||||
author: 'radishzz'
|
||||
// site url
|
||||
|
@ -41,7 +41,7 @@ site: {
|
|||
```ts
|
||||
color: {
|
||||
// default theme mode
|
||||
mode: 'light' // light, dark
|
||||
mode: 'light' // light, dark, auto
|
||||
// light mode
|
||||
light: {
|
||||
// primary color
|
||||
|
|
|
@ -25,7 +25,7 @@ site: {
|
|||
// descripción del sitio
|
||||
description: 'Retypeset is a static blog theme...'
|
||||
// usar título/subtítulo/descripción en varios idiomas desde src/i18n/ui.ts en lugar de los estáticos anteriores
|
||||
i18nTitle: true // light, dark, auto
|
||||
i18nTitle: true // true, false
|
||||
// nombre del autor
|
||||
author: 'radishzz'
|
||||
// url del sitio
|
||||
|
@ -41,7 +41,7 @@ site: {
|
|||
```ts
|
||||
color: {
|
||||
// modo de tema predeterminado
|
||||
mode: 'light' // light, dark
|
||||
mode: 'light' // light, dark, auto
|
||||
// modo claro
|
||||
light: {
|
||||
// color primario
|
||||
|
|
|
@ -25,7 +25,7 @@ site: {
|
|||
// サイト説明
|
||||
description: 'Retypeset is a static blog theme...'
|
||||
// 上記の静的設定の代わりに src/i18n/ui.ts の多言語タイトル/サブタイトル/説明を使用
|
||||
i18nTitle: true // light, dark, auto
|
||||
i18nTitle: true // true, false
|
||||
// 著者名
|
||||
author: 'radishzz'
|
||||
// サイトURL
|
||||
|
@ -41,7 +41,7 @@ site: {
|
|||
```ts
|
||||
color: {
|
||||
// デフォルトテーマモード
|
||||
mode: 'light' // light, dark
|
||||
mode: 'light' // light, dark, auto
|
||||
// ライトモード
|
||||
light: {
|
||||
// プライマリカラー
|
||||
|
|
|
@ -114,7 +114,6 @@ function isCurrentDark() {
|
|||
return false
|
||||
if (defaultMode === 'dark')
|
||||
return true
|
||||
// Auto mode or undefined, use system preference
|
||||
return window.matchMedia('(prefers-color-scheme: dark)').matches
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue