From 6701c462ee7e2f33f696a83d146973d4d5a357d5 Mon Sep 17 00:00:00 2001 From: Macky Date: Thu, 4 Jun 2026 09:20:28 +0700 Subject: [PATCH] fix: Thai line-height + add Kanit font variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add --font-display, --font-body, --font-mono CSS variables in :root (they were referenced everywhere but never defined; Kanit wasn't loading) - Remove Noto Sans Thai import (Kanit handles Latin + Thai natively) - Fix hero/PageHero line-height: 1/1.1 → 1.3 to prevent Thai vowel clipping (was caused by overflow:hidden on .word-wrapper combined with line-height:1) - Replace .word-wrapper overflow:hidden with padding so Thai descenders stay visible during kinetic-title animation - Bump word translateY from 100% → 110% so word slides up cleanly - Bump global h1-h6 line-height from 1.1 → 1.25 Build: 18 pages, 0 errors --- src/components/Hero.astro | 24 ++- src/components/PageHero.astro | 50 ++++-- src/layouts/Base.astro | 13 ++ src/pages/services/[slug].astro | 119 ++++++------- src/styles/global.css | 299 +++++++++++++++++++++++++++++++- 5 files changed, 426 insertions(+), 79 deletions(-) diff --git a/src/components/Hero.astro b/src/components/Hero.astro index 6e0090c..f123cec 100644 --- a/src/components/Hero.astro +++ b/src/components/Hero.astro @@ -3,6 +3,7 @@ * MOREMINIMORE - KINETIC HERO COMPONENT (LIGHT THEME) * Yellow/white/black editorial — no dark bg */ +import Icon from './Icon.astro'; interface Props { badge?: string; @@ -45,14 +46,14 @@ const titleWords = title.split(' ');
- +
{badge}
- -

+ +

{titleWords.map((word, index) => (
- ⭐ 50+ โปรเจกต์สำเร็จ + + + 50+ โปรเจกต์สำเร็จ + · 40+ ลูกค้าที่ไว้วางใจ · 5+ ปี · 100% โค้ดด้วยตัวเอง @@ -333,16 +337,19 @@ const titleWords = title.split(' '); font-family: var(--font-display); font-size: clamp(40px, 8vw, 90px); font-weight: 900; - line-height: 1; - letter-spacing: -0.02em; - text-transform: uppercase; + /* CRITICAL: line-height must be >1.2 to prevent Thai vowel clipping + when combined with overflow:hidden on .word-wrapper. */ + line-height: 1.3; + letter-spacing: -0.01em; color: var(--color-black); margin-bottom: 32px; } .word-wrapper { display: inline-block; - overflow: hidden; + /* Use padding (not overflow:hidden) so Thai descenders stay visible. */ + padding: 0.1em 0.05em; + margin: -0.1em -0.05em; } .word { @@ -470,6 +477,7 @@ const titleWords = title.split(' '); align-items: center; gap: 4px; } + .trust-icon { color: var(--color-primary); flex-shrink: 0; } /* ============================================ BACKGROUND TEXT (light yellow watermark) diff --git a/src/components/PageHero.astro b/src/components/PageHero.astro index 3785c0e..75a380b 100644 --- a/src/components/PageHero.astro +++ b/src/components/PageHero.astro @@ -1,7 +1,7 @@ --- /** - * MOREMINIMORE - PAGE HERO COMPONENT (LIGHT THEME) - * White bg + dark text + yellow accent line + * MOREMINIMORE - PAGE HERO COMPONENT (LIGHT THEME + ANIMATIONS) + * White bg + dark text + yellow accent line. Animated on load. */ interface Props { @@ -15,6 +15,9 @@ const { title, subtitle, } = Astro.props; + +// Split title into words for kinetic animation +const titleWords = title.split(' '); ---
@@ -26,13 +29,24 @@ const { {badge && ( {badge} )} -

{title}

+

+ {titleWords.map((word, index) => ( + + + {word} + + + ))} +

{subtitle && (

{subtitle}

)}
- +
@@ -40,7 +54,7 @@ const {