From c3e8e38a58baa3b2d3f2a4d1b14ebc92c791c8b7 Mon Sep 17 00:00:00 2001 From: Ilia Mashkov Date: Tue, 14 Jul 2026 16:59:48 +0300 Subject: [PATCH] fix(theme): fluid nav-title size and section rhythm off clamp tokens --- .../Section/ui/SectionAccordion/SectionAccordion.tsx | 12 +++++++----- src/shared/styles/theme.css | 5 +++++ .../ui/SectionsAccordion/SectionsAccordion.tsx | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/entities/Section/ui/SectionAccordion/SectionAccordion.tsx b/src/entities/Section/ui/SectionAccordion/SectionAccordion.tsx index c6bd2dd..d02d582 100644 --- a/src/entities/Section/ui/SectionAccordion/SectionAccordion.tsx +++ b/src/entities/Section/ui/SectionAccordion/SectionAccordion.tsx @@ -38,10 +38,12 @@ export function SectionAccordion({ number, title, id, isActive, href, children } return (
{isActive ? ( -
+
-
-

{heading}

+
+

+ {heading} +

@@ -52,9 +54,9 @@ export function SectionAccordion({ number, title, id, isActive, href, children } - + {heading} diff --git a/src/shared/styles/theme.css b/src/shared/styles/theme.css index 6208b3c..8fde364 100644 --- a/src/shared/styles/theme.css +++ b/src/shared/styles/theme.css @@ -21,6 +21,8 @@ --font-weight-normal: 400; --text-section-title: clamp(2rem, 7.5vw, 8rem); + /* Half of the active title so the active/inactive size ratio holds at every width */ + --text-nav-title: clamp(1.25rem, 3.75vw, 4rem); /* === LINE HEIGHT === */ --line-height-tight: 1.2; @@ -127,7 +129,10 @@ --container-section: var(--section-content-width); --spacing-footer: 5rem; --spacing-footer-wide: 4rem; + /* Active-section vertical rhythm — fluid so it tracks the clamp() title instead of jumping at sm */ + --spacing-section-gap: clamp(1.5rem, 5vw, 3.25rem); --text-section-title: var(--text-section-title); + --text-nav-title: var(--text-nav-title); --shadow-brutal-xs: var(--shadow-brutal-xs); --shadow-brutal-sm: var(--shadow-brutal-sm); diff --git a/src/widgets/SectionsAccordion/ui/SectionsAccordion/SectionsAccordion.tsx b/src/widgets/SectionsAccordion/ui/SectionsAccordion/SectionsAccordion.tsx index 106523a..73cffcd 100644 --- a/src/widgets/SectionsAccordion/ui/SectionsAccordion/SectionsAccordion.tsx +++ b/src/widgets/SectionsAccordion/ui/SectionsAccordion/SectionsAccordion.tsx @@ -28,7 +28,7 @@ export function SectionsAccordion({ sections, activeSlug, children }: Props) { const slots = Children.toArray(children); return ( -
+
{sections.map((section, i) => (