Skip to content

feat(Hero): make glass styles glass-theme only - #8365

Merged
mcoker merged 7 commits into
patternfly:mainfrom
kmcfaul:hero-bg
May 5, 2026
Merged

mcoker merged 7 commits into
patternfly:mainfrom
kmcfaul:hero-bg

Conversation

@kmcfaul

@kmcfaul kmcfaul commented May 4, 2026 •

Copy link
Copy Markdown
Contributor

Closes #8316.

Moves gradient, backdrop filter, and background image styles to glass theme only block (unless pf-m-no-glass).
Adds background color to base styles & set to primary background color (glass theme resets color to glass token).

Do we want to add a plain modifier opt in for non-glass theme? Hero is pretty opinionated in its styling so unsure if it's necessary to proactively add one.

Updated:

  • Keep background image and gradient in base styles
  • Adds pf-m-glass, making Hero glass styles opt-in
  • Removes pf-m-no-glass
  • Updates background color to tertiary
  • Updates padding to 3xl all around
  • Updates border radii to md/48px

Summary by CodeRabbit

  • Style

    • Refined Hero spacing, sizing and background composition; improved and reorganized glass-theme visuals and variables, including dark-theme compatibility.
    • Updated Card glass styling for consistent backdrop, border and shadow behavior.
  • Refactor

    • Simplified Hero template class construction and added a glass modifier flag for clearer modifier handling.
    • Demo updated to enable the Hero glass flag where applicable.
  • Documentation

    • Hero docs updated to show the current glass modifier usage.

@coderabbitai

coderabbitai Bot commented May 4, 2026 •

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: f0b48d2f-15bc-46bc-bdd8-9987bc45bb3c

📥 Commits

Reviewing files that changed from the base of the PR and between be99cb9 and bc72f4d.

📒 Files selected for processing (1)
  • src/patternfly/demos/Compass/examples/Compass.md

Walkthrough

Hero and Card SCSS were changed to move hero defaults off glass tokens, update paddings and radii, introduce component-scoped glass CSS custom properties, and re-scope glass styles under the glass theme + .pf-m-glass. The Hero template, Compass demo invocation, and Hero docs were updated accordingly.

Changes

Hero & Card theme / glass scoping

Layer / File(s) Summary
Token / Variable declarations
src/patternfly/components/Hero/hero.scss
Adjusted hero paddings to 3xl; changed hero background variable to tertiary default; removed root backdrop-filter; added --#{$hero}--m-glass--BackgroundColor, --#{$hero}--m-glass--BackdropFilter, --#{$hero}--m-glass--BorderColor, --#{$hero}--m-glass--BoxShadow; updated border radii and __body width constraints.
Core styling composition
src/patternfly/components/Hero/hero.scss
.#{$hero} now sets background-color and a multi-line background-image gradient using the updated variables (replaces prior single-line composition).
Theme wiring / scoping
src/patternfly/components/Hero/hero.scss, src/patternfly/components/Card/card.scss
Glass styling is re-scoped under :where(.<pf-prefix>theme-glass) so .pf-m-glass applies backdrop-filter/box-shadow and overrides via the new --...--m-glass--* vars; Card glass selector changed to a combined theme-scoped selector; theme-dark gradient overrides moved into the new scope.
Template wiring
src/patternfly/components/Hero/hero.hbs, src/patternfly/demos/Compass/examples/Compass.md
Hero template class construction switched to setModifiers with hero--IsGlass → pf-m-glass; Compass demo now invokes the hero partial with hero--IsGlass=true.
Documentation
src/patternfly/components/Hero/examples/Hero.md
Examples table updated to document .pf-m-glass modifier for .pf-v6-c-hero; the previous .pf-m-no-glass row removed.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

Needs design review

Suggested reviewers

  • mcoker
  • jcmill
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(Hero): make glass styles glass-theme only' follows conventional commit guidelines with 'feat' prefix and clear component/scope specification.
Linked Issues check ✅ Passed All coding requirements from #8316 are met: glass styles made opt-in via pf-m-glass modifier, base background changed to tertiary (non-transparent), padding updated to 3xl, and border radii updated to md/48px.
Out of Scope Changes check ✅ Passed All changes directly support the PR objectives: Hero SCSS variables/styling refactoring, template modifier implementation, Card SCSS glass selector simplification, and demo/documentation updates align with making glass styles opt-in.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kmcfaul
kmcfaul requested a review from mcoker May 4, 2026 14:32
Comment thread src/patternfly/components/Hero/hero.scss Outdated
@patternfly-build

patternfly-build commented May 4, 2026 •

Copy link
Copy Markdown
Collaborator

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/patternfly/components/Hero/hero.scss`:
- Around line 69-76: The change made glass styling conditional on an explicit
.pf-m-glass modifier inside the theme selector, which breaks existing Heroes in
.pf-v6-theme-glass; revert to applying the glass variables and properties by
default under :where(.#{$pf-prefix}theme-glass) & and instead add an opt-out
modifier .pf-m-no-glass that resets/overrides --#{$hero}--BorderColor,
--#{$hero}--BackgroundColor, --#{$hero}--m-glass--BackdropFilter, and
--#{$hero}--m-glass--BoxShadow (and the backdrop-filter/box-shadow declarations)
so consumers can opt out; keep .pf-m-glass only if you want it to explicitly
re-enable glass in non-theme contexts and ensure hero.hbs continues to only
output modifiers (no implicit behavior change).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 83040592-02cd-474b-961b-65ec91b26d23

📥 Commits

Reviewing files that changed from the base of the PR and between 2433c10 and 9b6368c.

📒 Files selected for processing (2)
  • src/patternfly/components/Hero/examples/Hero.md
  • src/patternfly/components/Hero/hero.scss

Comment thread src/patternfly/components/Hero/hero.scss Outdated

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (2)
src/patternfly/components/Card/card.scss (1)

143-150: 💤 Low value

Use $pf-prefix interpolation for the theme-glass selector to stay consistent with Hero.

hero.scss L69 in this same PR writes the parallel selector as :where(.#{$pf-prefix}theme-glass) &.pf-m-glass, while here the prefix is hardcoded as pf-v6-. Both produce the same class today, but the hardcoded form is easy to miss on a future prefix bump and diverges from the pattern used elsewhere in the codebase.

♻️ Proposed change
-  :where(.pf-v6-theme-glass) &.pf-m-glass {
+  :where(.#{$pf-prefix}theme-glass) &.pf-m-glass {
     --#{$card}--BackgroundColor: var(--#{$card}--m-glass--BackgroundColor);
     --#{$card}--BorderColor: var(--#{$card}--m-glass--BorderColor);
     --#{$card}--BorderWidth: var(--#{$card}--m-glass--BorderWidth);
-    
+
     backdrop-filter: var(--#{$card}--m-glass--BackdropFilter);
     box-shadow: var(--#{$card}--m-glass--BoxShadow);
   }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/patternfly/components/Card/card.scss` around lines 143 - 150, The theme
selector in Card (the :where(.pf-v6-theme-glass) &.pf-m-glass block) hardcodes
the prefix; change it to use the $pf-prefix interpolation (i.e.,
:where(.#{$pf-prefix}theme-glass) &.pf-m-glass) so it matches hero.scss and will
update correctly on prefix changes—update the selector only, leaving the inner
CSS custom properties (e.g., --#{$card}--BackgroundColor, backdrop-filter,
box-shadow) unchanged.
src/patternfly/components/Hero/hero.scss (1)

82-82: 💤 Low value

Trailing whitespace after closing brace.

Minor cleanup — there is a stray space after } on this line.

🧹 Proposed cleanup
-  } 
+  }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/patternfly/components/Hero/hero.scss` at line 82, There is a stray
trailing space after a closing brace in the Hero stylesheet; remove the extra
whitespace character that follows the `}` in hero.scss so the closing brace is
the final character on that line (no code changes beyond trimming the trailing
space).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/patternfly/components/Card/card.scss`:
- Around line 143-150: The theme selector in Card (the
:where(.pf-v6-theme-glass) &.pf-m-glass block) hardcodes the prefix; change it
to use the $pf-prefix interpolation (i.e., :where(.#{$pf-prefix}theme-glass)
&.pf-m-glass) so it matches hero.scss and will update correctly on prefix
changes—update the selector only, leaving the inner CSS custom properties (e.g.,
--#{$card}--BackgroundColor, backdrop-filter, box-shadow) unchanged.

In `@src/patternfly/components/Hero/hero.scss`:
- Line 82: There is a stray trailing space after a closing brace in the Hero
stylesheet; remove the extra whitespace character that follows the `}` in
hero.scss so the closing brace is the final character on that line (no code
changes beyond trimming the trailing space).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 84330ac9-fe8c-4c06-bd75-b912cb59d37b

📥 Commits

Reviewing files that changed from the base of the PR and between 9b6368c and cebeef3.

📒 Files selected for processing (2)
  • src/patternfly/components/Card/card.scss
  • src/patternfly/components/Hero/hero.scss

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/patternfly/demos/Compass/examples/Compass.md`:
- Line 33: The hero component invocation is passing the boolean modifier as a
bare positional argument (hero--IsGlass) which doesn't set the modifier; update
the hero invocation to pass the hash boolean explicitly (hero--IsGlass=true) so
the setModifiers logic applies and the pf-m-glass CSS class is added; locate the
hero usage ({{#> hero hero--IsGlass}}) and change the argument to the hash-style
boolean (hero--IsGlass=true) consistent with other modifiers.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 2892998d-ffdc-4f1a-a048-78acb5da48c9

📥 Commits

Reviewing files that changed from the base of the PR and between cebeef3 and be99cb9.

📒 Files selected for processing (2)
  • src/patternfly/components/Hero/hero.hbs
  • src/patternfly/demos/Compass/examples/Compass.md

Comment thread src/patternfly/demos/Compass/examples/Compass.md Outdated

@mcoker mcoker 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.

🚀

@mcoker
mcoker merged commit a52bf78 into patternfly:main May 5, 2026
5 checks passed
@patternfly-build

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 6.5.0-prerelease.82 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug - Hero background bugs

3 participants