Skip to content

Commit

Permalink
VAOS dynamically update heading 2 font-size based on screen width (#3…
Browse files Browse the repository at this point in the history
…3937)

* VAOS dynamically update heading 2 font-size based on screen width

* Update new appointment flow headers
  • Loading branch information
JunTaoLuo authored Jan 8, 2025
1 parent 77b6961 commit 9ed926c
Show file tree
Hide file tree
Showing 17 changed files with 34 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export default function DetailPageLayout({
<>
<BackLink appointment={appointment} />
<AppointmentCard appointment={appointment}>
<h1 className="vads-u-font-size--h2">{heading}</h1>
<h1 className="vaos__dynamic-font-size--h2">{heading}</h1>
{featureTravelPayViewClaimDetails && (
<ErrorAlert appointment={appointment} />
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default function ClinicChoicePage() {
<div className="vaos-form__radio-field">
{schema.properties.clinicId.enum.length === 2 && (
<>
<h1 className="vads-u-font-size--h2">{pageTitle}</h1>
<h1 className="vaos__dynamic-font-size--h2">{pageTitle}</h1>
{usingPastClinics && (
<>Your last {typeOfCareLabel} appointment was at </>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function CommunityCareLanguagePage({

return (
<div>
<h1 className="vads-u-font-size--h2">{pageTitle}</h1>
<h1 className="vaos__dynamic-font-size--h2">{pageTitle}</h1>
{!!schema && (
<SchemaForm
name="ccLanguage"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default function CommunityCareProviderSelectionPage() {

return (
<div>
<h1 className="vads-u-font-size--h2">{pageTitle}</h1>
<h1 className="vaos__dynamic-font-size--h2">{pageTitle}</h1>
{!!schema && (
<SchemaForm
name="ccPreferences"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default function ConfirmationDirectScheduleInfoV2({
const typeOfCareName = getTypeOfCareById(data.typeOfCareId)?.name;
return (
<>
<h1 className="vads-u-font-size--h2">
<h1 className="vaos__dynamic-font-size--h2">
{momentDate.format('dddd, MMMM D, YYYY [at] h:mm a')}
{` ${getTimezoneAbbrByFacilityId(data.vaFacility)}`}
</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export default function ContactInfoPage() {

return (
<div>
<h1 className="vads-u-font-size--h2">{pageTitle}</h1>
<h1 className="vaos__dynamic-font-size--h2">{pageTitle}</h1>
{!!schema && (
<SchemaForm
name="Contact info"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default function CCRequest() {

return (
<div className="vaos-form__detailed-radio">
<h1 className="vads-u-font-size--h2">{pageTitle}</h1>
<h1 className="vaos__dynamic-font-size--h2">{pageTitle}</h1>
<p>
You can select up to 3 preferred timeframes. We'll schedule your
appointment or call to schedule with you.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default function VARequest({ changeCrumb }) {

return (
<div className="vaos-form__detailed-radio">
<h1 className="vads-u-font-size--h2">
<h1 className="vaos__dynamic-font-size--h2">
{pageTitle}
<span className="schemaform-required-span vaos-calendar__page_header vads-u-font-family--sans vads-u-font-weight--normal">
(*Required)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default function DateTimeRequestPage({ changeCrumb }) {

return (
<div className="vaos-form__detailed-radio">
<h1 className="vads-u-font-size--h2">{pageTitle}</h1>
<h1 className="vaos__dynamic-font-size--h2">{pageTitle}</h1>
<p>
Choose your preferred date and time for this appointment. You can
request up to 3 dates. A scheduling coordinator will call you to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export default function DateTimeSelectPage() {

return (
<div>
<h1 className="vads-u-font-size--h2">{pageTitle}</h1>
<h1 className="vaos__dynamic-font-size--h2">{pageTitle}</h1>
{!loadingSlots && (
<WaitTimeAlert
eligibleForRequests={eligibleForRequests}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default function PreferredDatePage() {

return (
<div>
<h1 className="vads-u-font-size--h2">{pageTitle}</h1>
<h1 className="vaos__dynamic-font-size--h2">{pageTitle}</h1>
{!!schema && (
<SchemaForm
name="Type of appointment"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ export default function ReasonForAppointmentPage({ changeCrumb }) {
'vads-u-margin-top--neg3': !isCommunityCare,
})}
>
{isCommunityCare && <h1 className="vads-u-font-size--h2">{pageTitle}</h1>}
{isCommunityCare && (
<h1 className="vaos__dynamic-font-size--h2">{pageTitle}</h1>
)}
{!!schema && (
<SchemaForm
name="Reason for appointment"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ export default function ReviewDirectScheduleInfo({
}) {
return (
<div>
<h1 className="vaos-review__header vads-u-font-size--h2">{pageTitle}</h1>
<h1 className="vaos-review__header vaos__dynamic-font-size--h2">
{pageTitle}
</h1>
<TypeOfAppointmentSection data={data} />
<hr aria-hidden="true" className="vads-u-margin-y--2" />
<FacilitySection facility={facility} clinic={clinic} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ export default function ReviewRequestInfo({

return (
<div>
<h1 className="vaos-review__header vads-u-font-size--h2">{pageTitle}</h1>
<h1 className="vaos-review__header vaos__dynamic-font-size--h2">
{pageTitle}
</h1>
<TypeOfAppointmentSection data={data} />
<hr aria-hidden="true" className="vads-u-margin-y--2" />
{isCommunityCare && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export default function TypeOfCarePage() {

return (
<div className="vaos-form__radio-field">
<h1 className="vads-u-font-size--h2">
<h1 className="vaos__dynamic-font-size--h2">
{pageTitle}
<span className="schemaform-required-span vads-u-font-family--sans vads-u-font-weight--normal">
(*Required)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ export default function VAFacilityPageV2() {
[requestingLocation, requestLocationStatus, sortFocusEl],
);

const pageHeader = <h1 className="vads-u-font-size--h2">{pageTitle}</h1>;
const pageHeader = (
<h1 className="vaos__dynamic-font-size--h2">{pageTitle}</h1>
);

if (hasDataFetchingError) {
return (
Expand Down
10 changes: 10 additions & 0 deletions src/applications/vaos/sass/vaos.scss
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,14 @@ va-radio::part(legend) {
.schemaform-required-span,
body {
font-size: 1.06rem; // same as 16.96px
}

.vaos__dynamic-font-size--h2 {
font-size: var(--font-size-h2);
}

@media (max-width: 481px) {
.vaos__dynamic-font-size--h2 {
font-size: 24px;
}
}

0 comments on commit 9ed926c

Please sign in to comment.