Skip to content

Commit 311b6c7

Browse files
authored
chore: update headings (#5503)
* cleanup headings
1 parent 82f9765 commit 311b6c7

File tree

10 files changed

+66
-94
lines changed

10 files changed

+66
-94
lines changed

app/(gcforms)/[locale]/(app administration)/admin/(no nav)/typography/page.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ export default async function Page() {
1717
<p className="mb-4 font-lato">
1818
<strong>Heading font</strong>: Lato
1919
</p>
20-
<h1>H1 Heading (small: 34px, bold; large: 38px bold;)</h1>
21-
<h2>H2 Heading (small: 32px, bold; large: 36px bold;)</h2>
22-
<h3>H3 Heading (small: 24px, bold; large: 24px bold;)</h3>
23-
<h4>H4 Heading (small: 22px, bold; large: 22px bold;)</h4>
24-
<h5>H5 Heading (small: 20px, bold; large: 20px bold;)</h5>
25-
<h6>H6 Heading (small: 19px, normal; large: 19px normal;)</h6>
20+
<h1>H1 Heading</h1>
21+
<h2>H2 Heading</h2>
22+
<h3>H3 Heading</h3>
23+
<h4>H4 Heading</h4>
24+
<h5>H5 Heading</h5>
25+
<h6>H6 Heading</h6>
2626
</div>
2727

2828
<Heading title="Form builder + Admin" />
@@ -31,11 +31,11 @@ export default async function Page() {
3131
<strong>Heading font</strong>: Noto Sans
3232
</p>
3333

34-
<h1>H1 Heading (font-semibold small: text-3xl large: text-4xl)</h1>
35-
<h2>H2 Heading (font-semibold small: text-2xl large: text-3xl)</h2>
36-
<h3>H3 Heading (font-semibold small: text-xl large: text-2xl)</h3>
37-
<h4>H4 Heading (font-semibold small: text-lg large: text-xl)</h4>
38-
<h5>H5 Heading (font-normal small: text-base large: text-lg)</h5>
34+
<h1>H1 Heading</h1>
35+
<h2>H2 Heading</h2>
36+
<h3>H3 Heading</h3>
37+
<h4>H4 Heading</h4>
38+
<h5>H5 Heading</h5>
3939

4040
<Heading title="Text sizes" />
4141
<p className="text-xs">text-xs</p>

app/(gcforms)/[locale]/(form administration)/form-builder/[id]/preview/Preview.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { FormProperties, PublicFormRecord } from "@lib/types";
99
import { RichText } from "@clientComponents/forms";
1010
import { ClosingNotice } from "@clientComponents/forms/ClosingNotice/ClosingNotice";
1111
import { GcdsH1 } from "@serverComponents/globals/GcdsH1";
12+
import { GcdsHeader } from "@serverComponents/globals/GcdsHeader/GcdsHeader";
1213

1314
import {
1415
FormServerErrorCodes,
@@ -93,6 +94,8 @@ export const Preview = ({
9394

9495
const brand = formRecord?.form ? formRecord.form.brand : null;
9596

97+
const hasCustom = brand?.logoEn && brand?.logoFr;
98+
9699
const hasHydrated = useRehydrate();
97100

98101
if (isPastClosingDate) {
@@ -152,10 +155,14 @@ export const Preview = ({
152155
</>
153156
)}
154157

155-
<div className="gc-formview">
156-
<div className="mb-20 mt-0 border-b-4 border-blue-dark py-9">
157-
<Brand brand={brand} lang={language} className="max-w-[360px]" />
158-
</div>
158+
<div className="gc-formview gc-form-preview-header">
159+
{hasCustom ? (
160+
<div className="mb-20 mt-0 border-b-1 border-[var(--gcds-header-brand-border-color)] py-9 ">
161+
<Brand brand={brand} lang={language} className="max-w-[360px] " />
162+
</div>
163+
) : (
164+
<GcdsHeader pathname={""} language={language} showLanguageToggle={false} />
165+
)}
159166
</div>
160167

161168
{sent ? (

app/(gcforms)/[locale]/(support)/support/components/client/SupportForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export const SupportForm = () => {
103103
)}
104104

105105
<GcdsH1>{t("support.title")}</GcdsH1>
106-
<p className="-mt-8 mb-6">
106+
<p className="mb-6">
107107
{t("support.experience")}
108108
<Link href={`https://articles.alpha.canada.ca/forms-formulaires/${language}/guidance`}>
109109
{t("support.guidanceLink")}

app/(gcforms)/[locale]/(support)/support/page.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,9 @@ export async function generateMetadata(props: {
1616
}
1717

1818
export default async function Page() {
19-
return <SupportForm />;
19+
return (
20+
<div className="gc-formview">
21+
<SupportForm />
22+
</div>
23+
);
2024
}

components/clientComponents/forms/Form/Form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ const InnerForm: React.FC<InnerFormProps> = (props) => {
181181
isShowReviewPage &&
182182
currentGroup !== LockedSections.REVIEW &&
183183
currentGroup !== LockedSections.START && (
184-
<h2 className="pb-8" tabIndex={-1} ref={groupsHeadingRef}>
184+
<h2 tabIndex={-1} ref={groupsHeadingRef}>
185185
{getGroupTitle(currentGroup, language as Language)}
186186
</h2>
187187
)}

components/clientComponents/globals/Alert/Alert.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const Title = ({
3636
return (
3737
<HeadingTag
3838
data-testid="alert-heading"
39-
className={cn("!mb-0 pb-0", headingClasses[HeadingTag], statusClass, className)}
39+
className={cn("!mb-0 pb-0 !mt-0", headingClasses[HeadingTag], statusClass, className)}
4040
>
4141
{children}
4242
</HeadingTag>

components/clientComponents/globals/layouts/FormDisplayLayout.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ const FormDisplayHeader = ({
3636

3737
return (
3838
<header>
39-
<Fip formRecord={formRecord} className="mb-20 mt-0 border-b-4 border-blue-dark py-9">
39+
<Fip
40+
formRecord={formRecord}
41+
className="mb-20 mt-0 border-b-1 border-[var(--gcds-header-brand-border-color)] py-9"
42+
>
4043
<LanguageToggle />
4144
</Fip>
4245
</header>

components/serverComponents/globals/GcdsH1.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,7 @@ export const GcdsH1 = ({
1010
className?: string;
1111
}) => {
1212
return (
13-
<h1
14-
tabIndex={tabIndex || -1}
15-
className={cn(
16-
"relative !mb-12 inline-block border-none after:absolute after:-bottom-1 after:left-0 after:h-[var(--gcds-heading-h1-border-height)] after:w-[var(--gcds-heading-h1-border-width)] after:bg-[var(--gcds-heading-h1-border-background)] after:content-['']",
17-
className
18-
)}
19-
>
13+
<h1 tabIndex={tabIndex || -1} className={cn(className)}>
2014
{children}
2115
</h1>
2216
);

styles/_gc-header.scss

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
@import "../node_modules/@cdssnc/gcds-tokens/build/web/css/components/lang-toggle.css";
33
@import "../node_modules/@cdssnc/gcds-tokens/build/web/css/components/signature.css";
44

5-
65
.gcds-header__brand {
76
container: component brand / inline-size;
87
border-block-end: var(--gcds-header-brand-border-width) solid
@@ -34,8 +33,7 @@
3433
display: grid;
3534
grid-gap: var(--gcds-header-brand-grid-gap);
3635
grid-template-columns: 1fr 0.1fr;
37-
grid-template-areas:
38-
"signature toggle";
36+
grid-template-areas: "signature toggle";
3937
width: 90%;
4038
max-width: var(--gcds-header-container-max-width);
4139
margin: 0 auto;
@@ -138,3 +136,11 @@
138136
font-weight: 700;
139137
}
140138
}
139+
140+
141+
/* Override for Preview header */
142+
.gc-form-preview-header {
143+
.brand__container {
144+
width: 100%;
145+
}
146+
}

styles/_typography.scss

Lines changed: 22 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,23 @@
44
@apply text-base leading-7 text-slate-800;
55
}
66

7-
h1,
8-
.gc-h1 {
7+
h1 {
98
@apply text-3xl tablet:text-4xl font-semibold mb-6;
109
}
1110

12-
h2,
13-
.gc-h2 {
11+
h2 {
1412
@apply text-2xl tablet:text-3xl font-semibold mb-4;
1513
}
1614

17-
h3,
18-
.gc-h3 {
15+
h3 {
1916
@apply text-xl tablet:text-2xl font-semibold mb-2;
2017
}
2118

22-
h4,
23-
.gc-h4 {
19+
h4 {
2420
@apply text-lg tablet:text-xl font-semibold;
2521
}
2622

27-
h5 .gc-h5 {
23+
h5 {
2824
@apply text-base tablet:text-lg font-normal;
2925
}
3026

@@ -36,69 +32,18 @@
3632
}
3733

3834
@apply text-xl text-gray-front;
39-
40-
h1,
41-
h2,
42-
h3,
43-
h4,
44-
h5,
45-
h6 {
46-
font-variant-ligatures: no-common-ligatures;
47-
-webkit-font-smoothing: antialiased;
48-
@apply font-lato font-bold;
49-
}
50-
51-
h1,
52-
.gc-h1 {
53-
@apply border-b border-red pb-2 mb-16 text-[34px] tablet:text-[38px];
54-
}
55-
56-
h2,
57-
.gc-h2 {
58-
@apply mb-6 text-[32px] tablet:text-[36px];
59-
}
60-
61-
h3,
62-
.gc-h3 {
63-
@apply mb-6 text-[24px];
64-
}
65-
66-
h4,
67-
.gc-h4 {
68-
@apply mb-4 text-[22px];
69-
}
70-
71-
h5,
72-
.gc-h5 {
73-
@apply text-[20px];
74-
}
75-
76-
h6,
77-
.gc-h6 {
78-
@apply text-[19px] font-normal;
79-
}
8035
}
8136

8237
.gc-authpages {
83-
h1,
84-
.gc-h1 {
38+
h1 {
8539
@apply border-b-0 pb-2 mb-12;
8640
}
8741
}
8842
}
8943

90-
.gcds-page {
91-
/* ----- Default GCDS typography styles ----- */
92-
body {
93-
font: var(--gcds-font-text);
94-
}
95-
96-
@media only screen and (width < 48em) {
97-
body {
98-
font: var(--gcds-font-text-mobile);
99-
}
100-
}
101-
44+
// Headings
45+
.gcds-page,
46+
.gc-formview {
10247
h1,
10348
h2,
10449
h3,
@@ -192,6 +137,19 @@
192137
font: var(--gcds-heading-h6-mobile);
193138
}
194139
}
140+
}
141+
142+
.gcds-page {
143+
/* ----- Default GCDS typography styles ----- */
144+
body {
145+
font: var(--gcds-font-text);
146+
}
147+
148+
@media only screen and (width < 48em) {
149+
body {
150+
font: var(--gcds-font-text-mobile);
151+
}
152+
}
195153

196154
p {
197155
max-width: var(--gcds-text-character-limit);

0 commit comments

Comments
 (0)