Add subheading color support and update foreground type definitions

This commit is contained in:
Jakub Dorfman 2026-05-27 13:56:47 +02:00
parent 1b94a13d7e
commit af58adb345
4 changed files with 17 additions and 6 deletions

View file

@ -41,6 +41,7 @@
:root {
--fg-heading: var(--color-heading, #2c2c2c);
--fg-subheading: var(--color-subheading, #4a4a4a);
--fg-body: var(--color-text, #2c2c2c);
background: var(--color-bg, #faf8f5);
color: var(--fg-body);
@ -55,7 +56,12 @@
.text-fg-body\/70 { color: color-mix(in srgb, var(--fg-body, #2c2c2c) 70%, transparent); }
.text-fg-body\/60 { color: color-mix(in srgb, var(--fg-body, #2c2c2c) 60%, transparent); }
.text-fg-heading { color: var(--fg-heading, #2c2c2c); }
.text-fg-subheading { color: var(--color-subheading, #4a4a4a); }
.text-fg-subheading { color: var(--fg-subheading, #4a4a4a); }
.text-fg-subheading\/85 { color: color-mix(in srgb, var(--fg-subheading, #4a4a4a) 85%, transparent); }
.text-fg-subheading\/80 { color: color-mix(in srgb, var(--fg-subheading, #4a4a4a) 80%, transparent); }
.text-fg-subheading\/75 { color: color-mix(in srgb, var(--fg-subheading, #4a4a4a) 75%, transparent); }
.text-fg-subheading\/70 { color: color-mix(in srgb, var(--fg-subheading, #4a4a4a) 70%, transparent); }
.text-fg-subheading\/60 { color: color-mix(in srgb, var(--fg-subheading, #4a4a4a) 60%, transparent); }
body {
min-height: 100vh;

View file

@ -31,8 +31,11 @@
if (foreground.headingColor) {
parts.push(`--fg-heading: ${foreground.headingColor};`);
}
if (foreground.bodyColor) {
parts.push(`--fg-body: ${foreground.bodyColor};`);
if (foreground.textColor) {
parts.push(`--fg-body: ${foreground.textColor};`);
}
if (foreground.subheadingColor) {
parts.push(`--fg-subheading: ${foreground.subheadingColor};`);
}
return parts.join(' ');
}

View file

@ -11,11 +11,11 @@
<section class="relative flex min-h-[80vh] items-center justify-center overflow-hidden px-6 py-20 md:min-h-[90vh]">
<div class="relative z-10 mx-auto max-w-4xl text-center">
<h1 class="animate-fade-in text-5xl leading-tight md:text-7xl lg:text-8xl" style="font-family: 'Playfair Display', Georgia, serif;">
<h1 class="animate-fade-in text-5xl leading-tight text-fg-heading md:text-7xl lg:text-8xl" style="font-family: 'Playfair Display', Georgia, serif;">
{data.heading || 'Holistic and Experiential Learning about Happiness'}
</h1>
{#if data.subheading}
<p class="animate-fade-in mx-auto mt-6 max-w-2xl text-lg leading-relaxed text-fg-body/70 md:text-xl" style="animation-delay: 0.15s;">
<p class="animate-fade-in mx-auto mt-6 max-w-2xl text-lg leading-relaxed text-fg-subheading/70 md:text-xl" style="animation-delay: 0.15s;">
{data.subheading}
</p>
{/if}

View file

@ -16,8 +16,10 @@ export type BlockBackground = {
};
export type BlockForeground = {
mode: 'default' | 'custom';
headingColor: string;
bodyColor: string;
subheadingColor: string;
textColor: string;
};
export type ContentBlock = {