fix(public-site): honor dark theme surface colors

This commit is contained in:
2026-05-20 08:48:40 +02:00
committed by Paul Nothaft
parent e0ad7ac2a7
commit 8b72721812
5 changed files with 67 additions and 30 deletions
@@ -159,4 +159,33 @@ describe('publicSiteService', () => {
expect(payload.branding.colors.accentDark).toBe('#5C8762');
});
it('exposes surface tokens and uses theme-aware public site CSS', async () => {
const publicSiteRows = buildPublicSiteRows({});
const brandingRows = buildBrandingRows({
themeConfig: {
primaryColor: '#014E4E',
accentColor: '#017C7C',
backgroundColor: '#0D0D0D',
surfaceColor: '#111414',
elevatedColor: '#182222',
surfaceBorderColor: '#1E2E2E',
textColor: '#EBEBEB',
mutedTextColor: '#B6C2C2'
}
});
db.mockImplementationOnce(() => ({ whereIn: () => Promise.resolve(publicSiteRows) }));
db.mockImplementationOnce(() => ({ whereIn: () => Promise.resolve(brandingRows) }));
const payload = await getPublicSitePayload({ bypassCache: true });
expect(payload.branding.colors.surface).toBe('#111414');
expect(payload.branding.colors.elevated).toBe('#182222');
expect(payload.branding.colors.border).toBe('#1E2E2E');
expect(payload.branding.colors.mutedText).toBe('#B6C2C2');
expect(payload.baseCss).toContain('var(--brand-surface');
expect(payload.baseCss).toContain('var(--brand-muted-text');
});
});