refactor: update theme configuration and background styles

This commit is contained in:
radishzzz 2025-01-19 23:18:12 +00:00
parent 8eb0876c01
commit d148649454
9 changed files with 129 additions and 4214 deletions

View file

@ -9,7 +9,7 @@ interface Props {
const { postTitle, postDescription, postImage } = Astro.props
const { title, subtitle, description, author, url, favicon } = themeConfig.site
const { light: { backgroundStart: lightMode }, dark: { backgroundStart: darkMode } } = themeConfig.color
const { light: { backgroundTop: lightMode }, dark: { backgroundTop: darkMode } } = themeConfig.color
const { locale, moreLocale } = themeConfig.global
const { verification = {}, twitterID = '', facebookID = '', facebookLink = '', googleAnalyticsID = '', umamiAnalyticsID = '', siteScreenshot = '' } = themeConfig.seo ?? {}
const { google = '', bing = '', yandex = '', baidu = '' } = verification

View file

@ -16,13 +16,13 @@ export const themeConfig: ThemeConfig = {
color: {
mode: 'light',
light: {
primary: '#232323',
backgroundStart: '#ffffff',
backgroundEnd: '#ffeeee',
text: '#232323',
backgroundTop: '#f8f8f8',
backgroundEnd: '#FDE9EB',
},
dark: {
primary: '#000000',
backgroundStart: '#ffffff',
text: '#000000',
backgroundTop: '#ffffff',
backgroundEnd: '#000000',
},
},
@ -31,9 +31,8 @@ export const themeConfig: ThemeConfig = {
// GLOBAL SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> START
global: {
locale: 'zh', // zh, zh-tw, ja, en, es, ru, default locale setting
moreLocale: ['zh-tw', 'ja', 'en', 'es', 'ru'], // ['zh-tw', 'ja', 'en', 'es', 'ru'] not fill in the default locale code again
font: 'sans', // sans, serif, choose the font style for posts
toc: true, // true, false, whether to enable table of contents in posts
moreLocale: ['zh-tw', 'ja', 'en', 'es', 'ru'], // ['zh', 'zh-tw', 'ja', 'en', 'es', 'ru'] NOT fill in the default locale code again
font: 'sans', // sans, serif, italic, choose the font style for posts
},
// GLOBAL SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> END

View file

@ -1,9 +1,12 @@
---
import Head from '@/components/Head.astro'
import themeConfig from '@/config'
import '@/styles/global.css'
const fontStyle = `font-${themeConfig.global.font}`
---
<html lang={Astro.currentLocale || 'en-US'}>
<html lang={Astro.currentLocale || 'en-US'} class={fontStyle}>
<head>
<Head />
</head>

View file

@ -1,14 +1,14 @@
:root {
--uno-colors-primary: theme('colors.primary');
--uno-colors-backgroundStart: theme('colors.backgroundStart');
--uno-colors-text: theme('colors.text');
--uno-colors-backgroundTop: theme('colors.backgroundTop');
--uno-colors-backgroundEnd: theme('colors.backgroundEnd');
}
html {
--at-apply: 'min-h-full font-sans text-[62.5%] bg-gradient-to-b from-backgroundStart to-backgroundEnd c-primary antialiased scroll-smooth';
}
--at-apply: 'antialiased scroll-smooth text-62.5%';
}
body {
--at-apply: 'min-h-screen text-[1.6rem] m-0';
}
--at-apply: 'min-h-screen min-h-dvh bg-gradient-to-b from-backgroundTop to-backgroundEnd bg-fixed overscroll-none text-1.6rem c-text';
}
h1, h2, h3 {
text-rendering: optimizeLegibility;
}
@ -30,6 +30,6 @@ h5 {
h6 {
--at-apply: 'text-[1.6rem]';
}
:where(p) {
--at-apply: 'text-primary/85';
}
/* :where(p) {
--at-apply: 'text-text/85';
} */

View file

@ -14,13 +14,13 @@ export interface ThemeConfig {
color: {
mode: 'light' | 'dark'
light: {
primary: string
backgroundStart: string
text: string
backgroundTop: string
backgroundEnd: string
}
dark: {
primary: string
backgroundStart: string
text: string
backgroundTop: string
backgroundEnd: string
}
}
@ -29,7 +29,6 @@ export interface ThemeConfig {
locale: typeof langPath[number]
moreLocale: typeof langPath[number][]
font: string
toc: boolean
}
comment?: {