Merge branch 'fix-theme-logic'

This commit is contained in:
radishzzz 2025-04-06 03:17:06 +01:00
commit 2dd5410300
9 changed files with 12 additions and 10 deletions

View file

@ -24,7 +24,7 @@ export const themeConfig: ThemeConfig = {
// COLOR SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> START
color: {
// default theme mode
mode: 'light', // light, dark
mode: 'light', // light, dark, auto
light: {
// primary color
// used for title, hover, etc

View file

@ -41,7 +41,7 @@ site: {
```ts
color: {
// default theme mode
mode: 'light' // light, dark
mode: 'light' // light, dark, auto
// light mode
light: {
// primary color

View file

@ -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

View file

@ -41,7 +41,7 @@ site: {
```ts
color: {
// デフォルトテーマモード
mode: 'light' // light, dark
mode: 'light' // light, dark, auto
// ライトモード
light: {
// プライマリカラー

View file

@ -41,7 +41,7 @@ site: {
```ts
color: {
// режим темы по умолчанию
mode: 'light' // light, dark
mode: 'light' // light, dark, auto
// светлый режим
light: {
// основной цвет

View file

@ -41,7 +41,7 @@ site: {
```ts
color: {
// 默認主題
mode: 'light' // light, dark
mode: 'light' // light, dark, auto
// 亮色模式
light: {
// 高亮顏色

View file

@ -41,7 +41,7 @@ site: {
```ts
color: {
// 默认主题
mode: 'light' // light, dark
mode: 'light' // light, dark, auto
// 亮色模式
light: {
// 高亮颜色

View file

@ -110,8 +110,10 @@ function isCurrentDark() {
const currentTheme = localStorage.getItem('theme')
if (currentTheme)
return currentTheme === 'dark'
if (defaultMode)
return defaultMode === 'dark'
if (defaultMode === 'light')
return false
if (defaultMode === 'dark')
return true
return window.matchMedia('(prefers-color-scheme: dark)').matches
}

View file

@ -15,7 +15,7 @@ export interface ThemeConfig {
}
color: {
mode: 'light' | 'dark'
mode: 'light' | 'dark' | 'auto'
light: {
primary: string
secondary: string