Skip to content

Commit 6b1c796

Browse files
committed
fix(web): align page header sizing contract
1 parent f7642e6 commit 6b1c796

2 files changed

Lines changed: 43 additions & 8 deletions

File tree

packages/web/src/styles/components.css

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,14 @@
644644
min-width: 0;
645645
}
646646

647+
.page-header--primary {
648+
min-height: 56px;
649+
}
650+
651+
.page-header--secondary {
652+
min-height: 48px;
653+
}
654+
647655
.page-header__leading {
648656
display: flex;
649657
align-items: center;
@@ -689,12 +697,15 @@
689697
}
690698

691699
.page-header--primary .page-header__title {
692-
font-size: var(--text-lg);
693-
line-height: 1.1;
700+
font-size: 20px;
701+
line-height: 28px;
702+
font-weight: 600;
694703
}
695704

696705
.page-header--secondary .page-header__title {
697-
line-height: 1.25;
706+
font-size: 16px;
707+
line-height: 24px;
708+
font-weight: 600;
698709
}
699710

700711
.page-header__back {
@@ -9136,7 +9147,7 @@ textarea.input {
91369147

91379148
.mobile-page-header {
91389149
width: 100%;
9139-
min-height: 38px;
9150+
min-height: 44px;
91409151
gap: 0;
91419152
}
91429153

@@ -9150,10 +9161,10 @@ textarea.input {
91509161
}
91519162

91529163
.mobile-page-header .page-header__title {
9153-
font-size: 14px;
9164+
font-size: 16px;
91549165
font-weight: var(--font-semibold);
91559166
letter-spacing: 0.01em;
9156-
line-height: 1.25;
9167+
line-height: 24px;
91579168
}
91589169

91599170
.mobile-page-header .page-header__back {
@@ -9702,7 +9713,7 @@ textarea.input {
97029713

97039714
.mobile-sheet--fullscreen .page-header__title {
97049715
font-size: 16px;
9705-
line-height: 1.2;
9716+
line-height: 24px;
97069717
}
97079718

97089719
.mobile-sheet__action {

packages/web/src/styles/components.theme.test.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,23 +517,47 @@ describe("components.css theme-sensitive surfaces", () => {
517517
const pageHeader = getLastRuleBlock(".mobile-sheet--fullscreen .page-header");
518518
const mobilePageHeader = getLastRuleBlock(".mobile-page-header");
519519
const mobilePageHeaderLeading = getLastRuleBlock(".mobile-page-header .page-header__leading");
520+
const mobilePageHeaderTitle = getLastRuleBlock(".mobile-page-header .page-header__title");
520521
const mobilePageHeaderBack = getLastRuleBlock(".mobile-page-header .page-header__back");
521522
const headerLeading = getLastRuleBlock(".page-header__leading");
522523
const backButton = getLastRuleBlock(".mobile-sheet--fullscreen .page-header__back");
524+
const fullscreenTitle = getLastRuleBlock(".mobile-sheet--fullscreen .page-header__title");
523525
const headerActions = getLastRuleBlock(".page-header__actions");
524526

525527
expect(fullscreenHeader).toContain("padding: 0 var(--sp-3)");
526528
expect(pageHeader).toContain("width: 100%");
527-
expect(mobilePageHeader).toContain("min-height: 38px");
529+
expect(mobilePageHeader).toContain("min-height: 44px");
528530
expect(mobilePageHeaderLeading).toContain("gap: 8px");
531+
expect(mobilePageHeaderTitle).toContain("font-size: 16px");
532+
expect(mobilePageHeaderTitle).toContain("line-height: 24px");
529533
expect(mobilePageHeaderBack).toContain("min-height: 26px");
530534
expect(mobilePageHeaderBack).toContain("font-family: var(--font-mono)");
531535
expect(headerLeading).toContain("flex: 1");
532536
expect(backButton).toContain("background: transparent");
533537
expect(backButton).not.toContain("border-radius: 999px");
538+
expect(fullscreenTitle).toContain("font-size: 16px");
539+
expect(fullscreenTitle).toContain("line-height: 24px");
534540
expect(headerActions).toContain("margin-left: auto");
535541
});
536542

543+
it("keeps page header levels on the approved desktop sizing contract", () => {
544+
const baseTitle = getLastRuleBlock(".page-header__title");
545+
const primaryHeader = getLastRuleBlock(".page-header--primary");
546+
const secondaryHeader = getLastRuleBlock(".page-header--secondary");
547+
const primaryTitle = getLastRuleBlock(".page-header--primary .page-header__title");
548+
const secondaryTitle = getLastRuleBlock(".page-header--secondary .page-header__title");
549+
550+
expect(baseTitle).toContain("font-weight: 600");
551+
expect(primaryHeader).toContain("min-height: 56px");
552+
expect(secondaryHeader).toContain("min-height: 48px");
553+
expect(primaryTitle).toContain("font-size: 20px");
554+
expect(primaryTitle).toContain("line-height: 28px");
555+
expect(primaryTitle).toContain("font-weight: 600");
556+
expect(secondaryTitle).toContain("font-size: 16px");
557+
expect(secondaryTitle).toContain("line-height: 24px");
558+
expect(secondaryTitle).toContain("font-weight: 600");
559+
});
560+
537561
it("uses a unified inline sheet treatment for mobile selectors and keeps topbar controls height-aligned", () => {
538562
const inlineSheet = getLastRuleBlock(".mobile-inline-sheet");
539563
const inlineSheetAction = getLastRuleBlock(".mobile-inline-sheet__action");

0 commit comments

Comments
 (0)