Skip to content

feat(ui): add h1–h6 base typography styles#1746

Open
MartinS-git wants to merge 21 commits into
mainfrom
headline-definitions
Open

feat(ui): add h1–h6 base typography styles#1746
MartinS-git wants to merge 21 commits into
mainfrom
headline-definitions

Conversation

@MartinS-git

@MartinS-git MartinS-git commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Implement the Juno typography scale (h1–h6) across global.css, theme.css, and FormattedText
  • Fix ContentHeading to use the base h1 scale instead of overriding it
  • Fix h1 misuse in UI components: replace semantically incorrect <h1> tags with appropriate elements, resolving both visual regressions and accessibility issues

Changes

global.css@layer base

  • Added h1h6 base styles with IBM Plex Sans Bold, rem-based font sizes, and plain CSS numeric line-height values

theme.css@layer base

  • Added matching h1h6 styles for consumers using theme.css standalone
  • Moved into @layer base to respect cascade order (per Copilot review feedback)
  • Uses var(--font-sans) instead of hardcoded font stack

FormattedText/formatted-text.css

  • Aligned h1h6 font sizes and line-heights with the typography scale
  • Fixed h5 font size (1.03rem → 1.125rem)
  • Added missing h6 style
  • Removed redundant font-weight and font-style declarations (now inherited from base)

ContentHeading

  • Removed jn:font-bold and jn:text-lg overrides — these were overriding the h1 base style (1.69rem) with the smaller text-lg value (1.125rem)

Component heading fixes (accessibility + visual regression)

Several components used <h1> for UI labels (titles, section headings). After introducing the global h1 base style, these rendered at 27px — unintended. Each was reviewed for correct heading semantics and accessibility:

Component Before After Reason
Modal <h1> + jn:text-xl <h4> Dialog title — role="dialog" creates an isolated landmark; heading is correct and referenced via aria-labelledby. <h4> matches previous visual size.
Form <h1> + jn:text-2xl <h3> Form is a named content section; heading is appropriate. <h3> matches previous visual size.
FormSection <h1> + jn:text-lg <h4> One level below Form (<h3>) in the heading hierarchy.
SignInForm <h1> + jn:text-xl <h2> Often the primary content of a page; <h2> is a safe default for standalone and embedded use.
Message <h1> <strong> Alert title — not a navigable section. Adding it to the heading outline would mislead screen reader users navigating by heading, especially when multiple messages are visible.
IntroBox <h1> <p> (bold) Info box — not a document section. No heading outline entry needed. Bold styling preserved.
PopupMenu <h1> <span> Decorative menu section label — polluting the heading outline with dropdown menu internals is incorrect for screen reader navigation.
ContentHeading <h1> <h1> (unchanged) Intentional page-level heading. <h1> is semantically correct here.

Changeset

  • Minor version bump for @cloudoperators/juno-ui-components

Typography Scale

Element Font Weight Size (rem) Line-height
h1 IBM Plex Sans 700 1.69rem 1.375 (leading-snug)
h2 IBM Plex Sans 700 1.56rem 1.375 (leading-snug)
h3 IBM Plex Sans 700 1.44rem 1.375 (leading-snug)
h4 IBM Plex Sans 700 1.28rem 1.625 (leading-relaxed)
h5 IBM Plex Sans 700 1.125rem 1.625 (leading-relaxed)
h6 IBM Plex Sans 700 1rem 1.5 (leading-normal)

Closes #1737

@changeset-bot

changeset-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 05747d1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@cloudoperators/juno-ui-components Minor
@cloudoperators/juno-app-carbon Patch
@cloudoperators/juno-app-doop Patch
@cloudoperators/juno-app-example Patch
@cloudoperators/juno-app-greenhouse Patch
@cloudoperators/juno-app-heureka Patch
@cloudoperators/juno-app-supernova Patch
@cloudoperators/juno-app-template Patch
@cloudoperators/juno-messages-provider Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

🚀 View preview at
https://cloudoperators.github.io/juno/pr-preview/pr-1746/

Built to branch gh-pages at 2026-06-12 13:27 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@MartinS-git MartinS-git marked this pull request as ready for review June 8, 2026 13:57
@MartinS-git MartinS-git requested review from a team and franzheidl as code owners June 8, 2026 13:57
Copilot AI review requested due to automatic review settings June 8, 2026 13:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the Juno design-system heading typography scale (h1–h6) as base styles in the UI components package, and aligns the FormattedText component’s heading styles to the same sizes/line-heights.

Changes:

  • Added h1–h6 base typography rules (font-family/weight + size + line-height) in global.css.
  • Added corresponding heading rules to theme.css and updated FormattedText heading line-heights (including adding h6).
  • Added a changeset to release the update.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/ui-components/src/theme.css Adds heading typography rules (currently unlayered).
packages/ui-components/src/global.css Adds h1–h6 base styles in @layer base using prefixed Tailwind utilities for line-height.
packages/ui-components/src/components/FormattedText/formatted-text.css Aligns heading line-heights/sizes to the design-system scale; adds h6.
.changeset/typography-scale-headings.md Declares a minor version bump and describes the typography change.

Comment thread packages/ui-components/src/theme.css Outdated
@MartinS-git MartinS-git force-pushed the headline-definitions branch from 464f38f to e2a926b Compare June 10, 2026 10:03

@edda edda left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check all components for internal usage of h1 - h6. Now that we define global font-sizes for them, existing places where they were used might look differen. E.g. the title prop in the Message component renders an h1 with bold font. Previously this would render in standard text size but bold. After this change it will have the h1 font-size, which is not intended. It was semantically already a mistake to render an h1 for this, so we'll need to adjust it to something more fitting. Modal titles also use h1, which we probably want to change as well. I'm sure there are others...

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Comment thread packages/ui-components/src/components/Modal/Modal.component.tsx

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Comment thread packages/ui-components/src/components/Modal/Modal.component.tsx
Comment thread packages/ui-components/src/global.css Outdated
Comment thread packages/ui-components/src/theme.css Outdated
Implements the Juno typography scale for heading elements h1–h6 in the
@layer base section of global.css. Styles follow the defined spec:
IBM Plex Sans, weight 700, with rem-based font sizes and leading values
aligned to Tailwind's leading-snug (h1–h3), leading-relaxed (h4–h5),
and leading-normal (h6).

Closes #1737

Signed-off-by: MartinS-git <info@eyepic.de>
Signed-off-by: MartinS-git <info@eyepic.de>
…ies in h1–h6

Signed-off-by: MartinS-git <info@eyepic.de>
Update h1–h6 in formatted-text.css to match the defined typography scale:
- Align font-size and line-height with global.css values
- Fix h5 font-size (1.03rem → 1.125rem)
- Remove redundant font-weight and font-style declarations
- Add missing h6 style

Closes #1737

Signed-off-by: MartinS-git <info@eyepic.de>
Signed-off-by: MartinS-git <info@eyepic.de>
… theme.css

Signed-off-by: MartinS-git <info@eyepic.de>
ContentHeading renders an h1 — now that h1–h6 base styles are defined
in @layer base (global.css), the explicit jn:text-lg (1.125rem) was
overriding the intended h1 size (1.69rem). Removing both overrides
lets the base typography scale apply correctly.

Signed-off-by: MartinS-git <info@eyepic.de>
Signed-off-by: MartinS-git <info@eyepic.de>
…al.css h1–h6

Consistent with theme.css and formatted-text.css which also use plain
CSS values. Tailwind equivalent noted as comments.

Signed-off-by: MartinS-git <info@eyepic.de>
…lues

Signed-off-by: MartinS-git <info@eyepic.de>
…ements

Resolves accessibility regression caused by the global h1–h6 typography scale:
components that used <h1> for UI labels (titles, section headings) now rendered
at 27px, which was not intended.

Each element was reviewed for correct heading semantics:
- Modal: <h1> → <h4>; removed jn:text-xl/font-bold overrides
- Form: <h1> → <h3>; removed jn:text-2xl/font-bold overrides
- FormSection: <h1> → <h4>; removed jn:text-lg/font-bold overrides
- SignInForm: <h1> → <h2>; removed jn:text-xl/font-bold overrides
- Message: <h1> → <strong> (alert title, not a navigable section)
- IntroBox: <h1> → <p> (info box, no heading outline needed)
- PopupMenu: <h1> → <span> (decorative menu section label)
- ContentHeading: <h1> unchanged (intentional page-level heading)

Signed-off-by: MartinS-git <info@eyepic.de>
…overrides

Signed-off-by: MartinS-git <info@eyepic.de>
…rtions to SignInForm tests

- Modal: render ReactNode titles as <h4> instead of <div> so aria-labelledby
  always points to a semantic heading element
- SignInForm tests: assert heading level 2 explicitly to prevent silent
  regressions in heading semantics

Signed-off-by: MartinS-git <info@eyepic.de>
…ReactNode title

Signed-off-by: MartinS-git <info@eyepic.de>
…Modal ReactNode title HTML

- global.css, theme.css: replace font-weight: 700 with @apply jn:font-bold
- Modal: render ReactNode titles as <div role="heading" aria-level={4}> instead
  of <h4> to avoid invalid HTML (block elements nested inside heading elements)

Signed-off-by: MartinS-git <info@eyepic.de>
…sistency

Signed-off-by: MartinS-git <info@eyepic.de>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Comment thread packages/ui-components/src/components/Modal/Modal.component.tsx
Comment thread .changeset/typography-scale-headings.md Outdated
Comment thread .changeset/typography-scale-headings.md Outdated
…ct changeset inaccuracies

Signed-off-by: MartinS-git <info@eyepic.de>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Comment thread packages/ui-components/src/components/Modal/Modal.component.tsx Outdated
Comment thread packages/ui-components/src/global.css

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Comment thread packages/ui-components/src/components/Modal/Modal.component.tsx Outdated
…1.28rem, leading-relaxed, bold)

Signed-off-by: MartinS-git <info@eyepic.de>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Comment thread packages/ui-components/src/components/Modal/Modal.component.tsx
…ily consistency with h4 path

Signed-off-by: MartinS-git <info@eyepic.de>
…ull consistency

Signed-off-by: MartinS-git <info@eyepic.de>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Comment thread packages/ui-components/src/components/PopupMenu/PopupMenu.component.tsx Outdated
…prevent invalid HTML

Signed-off-by: MartinS-git <info@eyepic.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task](ui): Implement typography text styles

4 participants