Skip to content

Conversation

@MariaSolOs
Copy link
Contributor

Changes proposed in this pull request:

Headings should reflect their visual level on the page. <h6> isn't appropriate for a dialog title.

Screenshot

I changed the font size to preserve the current appearance of the title.

Today:
Screenshot 2025-11-26 at 11 21 54 AM

With this change:
Screenshot 2025-11-26 at 11 38 28 AM

@changelog-app
Copy link

changelog-app bot commented Nov 26, 2025

Generate changelog in packages/core/changelog/@unreleased

Type (Select exactly one)

  • Feature (Adding new functionality)
  • Improvement (Improving existing functionality)
  • Fix (Fixing an issue with existing functionality)
  • Break (Creating a new major version by breaking public APIs)
  • Deprecation (Removing functionality in a non-breaking way)
  • Migration (Automatically moving data/functionality to a new system)

Description

fix(a11y): use H2 header for dialog title

Check the box to generate changelog(s)

  • Generate changelog entry

.#{$ns}-heading {
@include overflow-ellipsis;
flex: 1 1 auto;
font-size: 14px;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if there's a special variable I can use here to reference the font size of h4 titles.

Copy link
Contributor

@gluxon gluxon Nov 26, 2025

Choose a reason for hiding this comment

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

You could do something like this, but it might be worth just hard-coding 14px since we may not want this font-size to change if the default h6 font size changes.

Suggested change
font-size: 14px;
font-size: list.nth(map.get($headings, "h6"), 1);
@use "sass:map";
@use "sass:list";
@import "../../common/typography";

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that's what I thought as well...

@svc-palantir-github
Copy link

fix(a11y): use `H2` header for dialog title

Build artifact links for this commit: documentation | landing | table | demo

This is an automated comment from the deploy-preview CircleCI job.

@MariaSolOs MariaSolOs requested a review from a team November 26, 2025 19:52
Copy link
Contributor

@gluxon gluxon left a comment

Choose a reason for hiding this comment

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

This looks good to me! Let's wait for @ggdouglas on the final approval.

Copy link
Contributor

@mm-wang mm-wang left a comment

Choose a reason for hiding this comment

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

Ah, I was actually thinking to have a prop on dialog that would allow a user to specify which heading level that they would want, rather than a specific heading. See #7405 and #6757 for more details.

@MariaSolOs
Copy link
Contributor Author

MariaSolOs commented Nov 26, 2025

Ah, I was actually thinking to have a prop on dialog that would allow a user to specify which heading level that they would want, rather than a specific heading. See #7405 and #6757 for more details.

Instead of adding a new prop, here's another proposal: Let's change the type of title in

to string | React.Node. If it's a string then we render it inside an H2 header, else we use the provided node as is. That would keep a reasonable default while still allowing for further title customization.

WDYT @mm-wang?

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.

5 participants