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 SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> START
color: { color: {
// default theme mode // default theme mode
mode: 'light', // light, dark mode: 'light', // light, dark, auto
light: { light: {
// primary color // primary color
// used for title, hover, etc // used for title, hover, etc

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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