mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-16 11:41:17 +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
|
// site description
|
||||||
description: 'Retypeset is a static blog theme...'
|
description: 'Retypeset is a static blog theme...'
|
||||||
// use i18n title/subtitle/description from src/i18n/ui.ts instead of static ones above
|
// 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 name
|
||||||
author: 'radishzz'
|
author: 'radishzz'
|
||||||
// site url
|
// site url
|
||||||
|
@ -41,7 +41,7 @@ site: {
|
||||||
```ts
|
```ts
|
||||||
color: {
|
color: {
|
||||||
// default theme mode
|
// default theme mode
|
||||||
mode: 'light' // light, dark
|
mode: 'light' // light, dark, auto
|
||||||
// light mode
|
// light mode
|
||||||
light: {
|
light: {
|
||||||
// primary color
|
// primary color
|
||||||
|
|
|
@ -25,7 +25,7 @@ site: {
|
||||||
// descripción del sitio
|
// descripción del sitio
|
||||||
description: 'Retypeset is a static blog theme...'
|
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
|
// 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
|
// nombre del autor
|
||||||
author: 'radishzz'
|
author: 'radishzz'
|
||||||
// url del sitio
|
// url del sitio
|
||||||
|
@ -41,7 +41,7 @@ site: {
|
||||||
```ts
|
```ts
|
||||||
color: {
|
color: {
|
||||||
// modo de tema predeterminado
|
// modo de tema predeterminado
|
||||||
mode: 'light' // light, dark
|
mode: 'light' // light, dark, auto
|
||||||
// modo claro
|
// modo claro
|
||||||
light: {
|
light: {
|
||||||
// color primario
|
// color primario
|
||||||
|
|
|
@ -25,7 +25,7 @@ site: {
|
||||||
// サイト説明
|
// サイト説明
|
||||||
description: 'Retypeset is a static blog theme...'
|
description: 'Retypeset is a static blog theme...'
|
||||||
// 上記の静的設定の代わりに src/i18n/ui.ts の多言語タイトル/サブタイトル/説明を使用
|
// 上記の静的設定の代わりに src/i18n/ui.ts の多言語タイトル/サブタイトル/説明を使用
|
||||||
i18nTitle: true // light, dark, auto
|
i18nTitle: true // true, false
|
||||||
// 著者名
|
// 著者名
|
||||||
author: 'radishzz'
|
author: 'radishzz'
|
||||||
// サイトURL
|
// サイトURL
|
||||||
|
@ -41,7 +41,7 @@ site: {
|
||||||
```ts
|
```ts
|
||||||
color: {
|
color: {
|
||||||
// デフォルトテーマモード
|
// デフォルトテーマモード
|
||||||
mode: 'light' // light, dark
|
mode: 'light' // light, dark, auto
|
||||||
// ライトモード
|
// ライトモード
|
||||||
light: {
|
light: {
|
||||||
// プライマリカラー
|
// プライマリカラー
|
||||||
|
|
|
@ -114,7 +114,6 @@ function isCurrentDark() {
|
||||||
return false
|
return false
|
||||||
if (defaultMode === 'dark')
|
if (defaultMode === 'dark')
|
||||||
return true
|
return true
|
||||||
// Auto mode or undefined, use system preference
|
|
||||||
return window.matchMedia('(prefers-color-scheme: dark)').matches
|
return window.matchMedia('(prefers-color-scheme: dark)').matches
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue