Skip to content

Conversation

@HadassahYelenik
Copy link
Collaborator

Fixes #2164

Changes

  • Removed !important flags from #container #header/#body ::slotted heading selectors in rh-card.css
  • Added clarifying comments explaining the default and override behavior

Problem

Card titles in asset and title-bar patterns were not matching Figma specs because heading styles from the constructed stylesheet were using !important, which prevented pattern-level CSS from applying body-text tokens.

Solution

Removed !important to allow patterns to override typography with their inline styles using body-text tokens as designed.

Testing

Pattern demos already have correct inline styles with body-text tokens - they were just being blocked by !important.

@changeset-bot
Copy link

changeset-bot bot commented Oct 30, 2025

🦋 Changeset detected

Latest commit: 4b540fd

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

This PR includes changesets to release 1 package
Name Type
@rhds/elements 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

@netlify
Copy link

netlify bot commented Oct 30, 2025

Deploy Preview for red-hat-design-system ready!

Name Link
🔨 Latest commit 4b540fd
🔍 Latest deploy log https://app.netlify.com/projects/red-hat-design-system/deploys/690a3a1a797e820007a4c3ca
😎 Deploy Preview https://deploy-preview-2695--red-hat-design-system.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@HadassahYelenik HadassahYelenik changed the base branch from staging/doduo to main October 30, 2025 19:31
@HadassahYelenik HadassahYelenik changed the title fix(card): remove !important from card heading selectors to allow pattern overrides fix(card): card title typography in asset and title-bar patterns Oct 30, 2025
…verrides

Removes !important flags from #container #header/#body ::slotted heading
selectors in rh-card.css. This allows asset and title-bar card patterns
to override heading typography with body-text tokens as specified in
their inline styles.

Fixes RedHat-UX#2164
font-weight: var(--rh-font-weight-heading-regular, 300);
font-size: var(--rh-font-size-body-text-md, 1rem);
font-family: var(--rh-font-family-body-text);
color: var(--rh-color-text-brand-on-light, #ee0000);
Copy link
Collaborator

Choose a reason for hiding this comment

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

@marionnegp can you confirm that we'd need to use the theming token light-dark() variation here: --rh-color-text-brand.

var(--rh-color-brand-red, 
  light-dark(
    var(--rh-color-brand-red-on-light, #ee0000), 
    var(--rh-color-brand-red-on-dark, #ee0000)
  )
);

Copy link
Collaborator

@marionnegp marionnegp Nov 4, 2025

Choose a reason for hiding this comment

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

See my reply to the other comment.

font-weight: var(--rh-font-weight-heading-regular, 300);
font-size: var(--rh-font-size-body-text-md, 1rem);
font-family: var(--rh-font-family-body-text);
color: var(--rh-color-text-brand-on-light, #ee0000);
Copy link
Collaborator

@zeroedin zeroedin Nov 4, 2025

Choose a reason for hiding this comment

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

--rh-color-text-brand likely here as well @marionnegp

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yep! I think this code predates the switch to light-dark. However, we need to adjust the font weight for the brand red text to have enough color contrast at this font size. I'll make a separate comment for that.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Actually, is it possible to use --rh-color-text-brand for the title text in light scheme and --rh-color-text-primary in dark scheme?

A medium font weight still isn't bold enough to satisfy the color contrast requirements, and I don't think we want these card headings to be bold or much bigger. I think switching the color to white in dark scheme is our best bet.

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

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[bug] title style fixes

4 participants