Skip to content

Commit 7dedd96

Browse files
committed
fix: wire magzine primary color palette
1 parent c7fe94e commit 7dedd96

7 files changed

Lines changed: 10 additions & 4 deletions

File tree

conf/themeColorPalette.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const THEME_COLOR_DEFAULTS = {
6464
},
6565
hexo: { PRIMARY: '#928CEE', BG: '#f5f5f5', TEXT: '#374151' },
6666
landing: { PRIMARY: '#ef4444' },
67-
magzine: { BG: '#f6f6f1' },
67+
magzine: { PRIMARY: '#7BE986', PRIMARY_DARK: '#62BA6B', BG: '#f6f6f1' },
6868
matery: { PRIMARY: '#4338ca', BG: '#f5f5f5' },
6969
medium: { PRIMARY: '#4f46e5' },
7070
movie: { PRIMARY: '#2563eb', PRIMARY_DARK: '#ca8a04' },

conf/themeSwitch.manifest.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,13 @@ export const THEME_SWITCH_MANIFEST = {
201201
name: 'Magazine',
202202
summary: '杂志封面与大图列表风格。',
203203
palette: [
204+
{ key: 'MAGZINE_COLOR_PRIMARY', cssVar: '--magzine-color-primary', label: '主色', defaultValue: '#7BE986' },
204205
{ key: 'MAGZINE_COLOR_BG', cssVar: '--magzine-color-bg', label: '页面背景', defaultValue: '#f6f6f1' },
205206
{ key: 'MAGZINE_COLOR_CARD', cssVar: '--magzine-color-card', label: '卡片背景', defaultValue: '#ffffff' },
206207
{ key: 'MAGZINE_COLOR_TEXT', cssVar: '--magzine-color-text', label: '主文字', defaultValue: '#111827' },
207208
{ key: 'MAGZINE_COLOR_BORDER', cssVar: '--magzine-color-border', label: '边框', defaultValue: '#d1d5db' },
208209
{ key: 'MAGZINE_COLOR_SCROLLBAR', cssVar: '--magzine-color-scrollbar', label: '滚动条', defaultValue: '#4e4e4e' },
210+
{ key: 'MAGZINE_COLOR_PRIMARY_DARK', cssVar: '--magzine-color-primary-dark', label: '深色模式:主色', defaultValue: '#62BA6B' },
209211
{ key: 'MAGZINE_COLOR_BG_DARK', cssVar: '--magzine-color-bg-dark', label: '深色模式:页面背景', defaultValue: '#0b0f19' },
210212
{ key: 'MAGZINE_COLOR_NAV_DARK', cssVar: '--magzine-color-nav-dark', label: '深色模式:导航背景', defaultValue: '#111827' },
211213
{ key: 'MAGZINE_COLOR_CARD_DARK', cssVar: '--magzine-color-card-dark', label: '深色模式:卡片背景', defaultValue: '#1f2937' },

themes/magzine/components/BannerItem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default function BannerItem() {
2727
<h2 className='text-2xl font-semibold'>{title}</h2>
2828
<h3 className='text-sm'>{description}</h3>
2929
{button && (
30-
<div className='mt-2 text-center px-6 py-3 font-semibold rounded-3xl text-black bg-[#7BE986] hover:bg-[#62BA6B]'>
30+
<div className='mt-2 text-center px-6 py-3 font-semibold rounded-3xl text-black bg-[var(--magzine-console-primary)] hover:bg-[var(--magzine-console-primary)]'>
3131
<SmartLink href={url}>{text}</SmartLink>
3232
</div>
3333
)}

themes/magzine/components/CTA.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function CTA({ notice }) {
1212
<Announcement
1313
post={notice}
1414
className={
15-
'cta text-center text-black bg-[#7BE986] dark:bg-hexo-black-gray py-16'
15+
'cta text-center text-black bg-[var(--magzine-console-primary)] py-16'
1616
}
1717
/>
1818
</>

themes/magzine/components/TouchMeCard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default function TouchMeCard() {
1616
return (
1717
<div className={'relative h-32 text-black flex flex-col'}>
1818
<FlipCard
19-
className='cursor-pointer lg:py-8 px-4 py-4 border bg-[#7BE986] dark:bg-yellow-600 dark:border-gray-600'
19+
className='cursor-pointer lg:py-8 px-4 py-4 border bg-[var(--magzine-console-primary)] dark:border-gray-600'
2020
frontContent={
2121
<div className='h-full'>
2222
<h2 className='font-[1000] text-3xl'>

themes/magzine/config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
const CONFIG = {
2+
MAGZINE_COLOR_PRIMARY: '#7BE986',
3+
MAGZINE_COLOR_PRIMARY_DARK: '#62BA6B',
24
MAGZINE_COLOR_BG: '#f6f6f1',
35
MAGZINE_COLOR_SCROLLBAR: '#4e4e4e',
46

themes/magzine/style.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* eslint-disable react/no-unknown-property */
22
import CONFIG from './config'
3+
import { buildThemePrimaryCss } from '@/lib/themeColorCss'
34
import { themeConsoleStyle } from '@/lib/themeConsoleStyle'
45
/**
56
* 此处样式只对当前主题生效
@@ -28,6 +29,7 @@ const Style = () => {
2829
}
2930
3031
${themeConsoleStyle('magzine', CONFIG)}
32+
${buildThemePrimaryCss('#theme-magzine', '--magzine-console-primary')}
3133
`}</style>
3234
)
3335
}

0 commit comments

Comments
 (0)