Skip to content

MWPW-203933: JP Discover page font styling - #698

Open
echen-adobe wants to merge 13 commits into
stagefrom
jp-discover-font-styling
Open

MWPW-203933: JP Discover page font styling#698
echen-adobe wants to merge 13 commits into
stagefrom
jp-discover-font-styling

Conversation

@echen-adobe

Copy link
Copy Markdown
Contributor

Summary

Adds a toggleable JP typography override (font-styling: jp page/domain metadata) for Discover pages. Legacy --heading/body-font-size-* tokens don't have responsive tiers and overshoot the Figma-approved JP scale; font-styling-jp.css redefines those shared custom properties across a mobile/tablet tier and a >=1200px desktop tier so blocks consuming them (long-form article body, hero/marquee heading, blog.css h3, discover-cards flip headings) pick up correct JP sizing without per-block authoring.


Jira Ticket

Resolves: MWPW-203933


Test URLs

Env URL
Before https://main--da-express-milo--adobecom.aem.page/drafts/echen/jp-font-page
After https://jp-discover-font-styling--da-express-milo--adobecom.aem.page/drafts/echen/jp-font-page?martech=off

Verification Steps

  • Load the After URL and compare heading/body sizes against the Before URL at mobile (<600px), tablet (600-1199px), and desktop (>=1200px) widths.
  • Hero/marquee H1 should be 28px on mobile/tablet, stepping up to 36px on desktop.
  • Long-form article body headings (h2/h3) and body copy line-height should follow the JP scale/spacing rather than the legacy defaults.
  • Confirm blog.css h3 and discover-cards flip-card headings still render correctly (line-height fix only, no size regression).

Potential Regressions

N/A


Additional Notes

N/A

Legacy heading/body size tokens overshoot the Figma-approved JP scale and
their line-heights are too tight for Adobe Clean Han, hurting legibility on
JP Discover pages. font-styling-jp.css redefines the shared typography
custom properties so every block that already consumes them picks up the
JP scale with no per-block authoring; two hardcoded exceptions (blog.css
section h3, discover-cards flip-card headings) get scoped overrides via
:not(#_) instead of !important. Loaded only when a page or domain sets
`font-styling: jp` metadata.
… body

The long-form/long-form-blog styles that actually render Discover article
content read a third, previously-untouched typography namespace
(--Global-Typography-Size-Headings-Heading-XL/L, --Global-Typography-Size-
Body-Body-M) for the bulk of the page's headings and all body copy, so the
first pass looked like no change had happened. Override those tokens too,
including the 1200px breakpoint that re-escalates them back to the old
sizes, and fix the two hardcoded line-heights that don't read any token.
Also trim() the metadata value before comparing, defensively.
… tier

Checked the desktop-scoped Figma node (7643-98563) against the mobile one
used earlier: --ax-heading-* and --Global-Typography-Size-Headings-*/Body-
Body-M already match the approved JP scale natively at both the mobile
base and the 1200px breakpoint, so freezing them to the mobile value was
wrong and shrank desktop text below spec. Reverting that. The actual gap
is that the legacy --heading/body-font-size-* tokens have no responsive
tier at all; this adds the matching 1200px values confirmed by the same
two Figma nodes.
The header comment contained the literal substring "Heading-*/Body" -
an asterisk immediately followed by a slash, which is a CSS comment
terminator. That closed the comment early; everything after it (plain
English) was invalid CSS, so the parser's error recovery skipped ahead
and ate the entire base :root {} block along with it. Verified via
CSSStyleSheet.replaceSync() before and after: 5 rules (base :root
missing) -> 6 rules (base :root present). This is why the site only
ever showed the >=1200px override and never the mobile-tier values.
.section.long-form binds each heading level one tier below the JP text
style the Figma discover design assigns it (h2 reads --heading-font-size-m
but design wants Headings/L; h3 reads --heading-font-size-s but wants
Headings/M), so redefining root vars couldn't reach the spec without
dragging every other block that shares those tokens. Re-point h2->L and
h3->M with selectors scoped to non-blog long-form. Body/M and h4-h6 were
already correct. Verified level->style mapping against Figma nodes
7427:77355 (h2=Headings/L) and 7427:77364/77367 (h3=Headings/M).
Verified against Figma nodes 7319-154859 (mobile) and 7868-41979 (tablet):
every typography token is identical across the 320-1199 range; the tablet
node differs only in grid/padding. So the base :root block already covers
mobile and tablet, and >=1200 is the only step-up. Added a note so a
future dev doesn't add a redundant 600-1199 tier. No behavior change.
@aem-code-sync

aem-code-sync Bot commented Aug 18, 2026

Copy link
Copy Markdown

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run all PSI checks
  • Re-run failed PSI checks
  • Re-sync branch
Commits

@github-actions github-actions Bot added the Ready for Review Ready for peer review. label Aug 18, 2026
@aem-code-sync

aem-code-sync Bot commented Aug 18, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants