Skip to content

feat(glass): backgrounds for glass and compass - #8356

Merged
mcoker merged 14 commits into
patternfly:mainfrom
jcmill:feat/8287-glass-theme-background
May 12, 2026
Merged

mcoker merged 14 commits into
patternfly:mainfrom
jcmill:feat/8287-glass-theme-background

Conversation

@jcmill

@jcmill jcmill commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes: #8287

Implements a global background image strategy for glass themes.

Background image handling:

  • Moved background images from component-level to the root (HTML element)
  • Created theme-specific background image tokens located in token-local theme specific files
  • Each glass theme token file overrides --pf-t--global--background--image--default with fallbacks for its theme-specific variant

Compass component updates:

  • Removed component-specific background image handling
  • Added --pf-v6-c-compass--BackgroundColor with default secondary background color
  • In glass themes, Compass background becomes transparent so the HTML element's background image shows through
  • Restructured to use compass-container wrapper for improved layout control

Summary by CodeRabbit

  • New Features

    • Added a compass-container component as the required layout wrapper and simplified Compass wrapper markup.
    • Added local glass/felt theme token sets and a new glass-theme box-shadow CSS variable.
  • Style

    • Compass now uses a background-color approach with adjusted height/structure for consistent layout.
    • Normalized global background-image behavior and removed legacy theme image overrides.
  • Documentation

    • Updated Compass examples and usage guidance to reflect the new container pattern.

@jcmill
jcmill requested review from kmcfaul, lboehling and mcoker April 30, 2026 20:58
@coderabbitai

coderabbitai Bot commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

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: a173218c-98a4-4225-a833-98fcaff149e5

📥 Commits

Reviewing files that changed from the base of the PR and between a40eeee and 0c6d117.

📒 Files selected for processing (2)
  • src/patternfly/demos/Compass/compass--docked.hbs
  • src/patternfly/demos/Compass/examples/Compass.md

Walkthrough

Moves glass/felt background-image handling into theme-scoped token mixins, removes global background-image rules from patternfly.scss, adds local glass/felt token modules, and restructures Compass by introducing a .pf-v6-c-compass__container wrapper and switching Compass from image backgrounds to a background-color token. (33 words)

Changes

Cohort / File(s) Summary
Normalizations & variables
src/patternfly/base/normalize.scss, src/patternfly/base/patternfly-variables.scss
Adds :where(html) selector in normalize; imports local felt/glass token modules and includes those token mixins into glass-themed :root blocks; introduces --pf-t--global--box-shadow--glass--default mapping for glass scope.
Base local tokens
src/patternfly/base/tokens/tokens-local.scss
Removes glass-themed box-shadow override and sets --pf-t--global--background--image--default: none; in the base pf-v6-tokens mixin (to be overridden by theme-specific mixins).
Local theme token mixins
src/patternfly/base/tokens/tokens-local-glass.scss, src/patternfly/base/tokens/tokens-local-glass-dark.scss, src/patternfly/base/tokens/tokens-local-felt-glass.scss, src/patternfly/base/tokens/tokens-local-felt-glass-dark.scss
Adds four @mixin pf-v6-tokens files that set --pf-t--global--background--image--default to theme-specific image token values with SVG fallbacks.
Normalize small cleanup
src/patternfly/base/normalize.scss
Removes stray whitespace-only scrollbar line and adds :where(html) selector for PatternFly default background-image behavior.
Compass templates & demos
src/patternfly/components/Compass/compass.hbs, src/patternfly/components/Compass/compass-container.hbs, src/patternfly/demos/Compass/compass--card-view.hbs, src/patternfly/demos/Compass/compass--docked.hbs, src/patternfly/demos/Compass/examples/Compass.md
Introduces compass-container template, simplifies compass.hbs wrapper, updates demos/examples to wrap regions inside the new container and retarget .pf-m-docked to the container.
Compass styles
src/patternfly/components/Compass/compass.scss
Replaces image-based theming with a --BackgroundColor token; removes background-image variables/overrides; sets .pf-compass to height: 100dvh and makes container inherit; moves animation variable scope to container when pf-m-animate-smoothly is present.
Global stylesheet cleanup
src/patternfly/patternfly.scss
Removes previous theme-conditional background-image and related background-* rules previously applied to body and .pf-v6-c-compass for glass variants.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

Needs design review

Suggested reviewers

  • mcoker
  • kmcfaul
  • lboehling
🚥 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 PR title 'feat(glass): backgrounds for glass and compass' follows conventional commit guidelines with a type prefix (feat) and scope (glass), accurately describing the main change of implementing global background images for glass themes and Compass component.
Linked Issues check ✅ Passed The PR comprehensively addresses all coding objectives from issue #8287: centralized background-image responsibility to root HTML scope, created theme-specific tokens with fallbacks, restructured Compass with container wrapper, and enabled flexible CSS variable overrides for theme application.
Out of Scope Changes check ✅ Passed All changes are within scope of issue #8287's objectives: background token implementations, normalize.scss updates for HTML root styling, Compass restructuring with container wrapper, and documentation updates directly support the global background strategy and flexible application options.

✏️ 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
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

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

@patternfly-build

patternfly-build commented Apr 30, 2026 •

Copy link
Copy Markdown
Collaborator

@patternfly-build

Copy link
Copy Markdown
Collaborator

A11y report: https://pf-pr-8356-a11y.surge.sh

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/patternfly/components/Compass/examples/Compass.md (1)

60-84: ⚠️ Potential issue | 🟠 Major

Move the masthead inside the docked container.

The docked example renders masthead as a sibling outside compass-container, but compass--HasDock=true applies the pf-m-docked class to compass-container itself. The docked styles defined in compass.scss at lines 116–120 target .pf-v6-c-compass__container.pf-m-docked > .pf-v6-c-masthead—a direct child relationship that the current example does not satisfy. Move masthead inside compass-container so the docked masthead styles apply as intended.

Proposed fix
 {{#> compass compass--HasDock=true}}
-  {{#> masthead masthead--IsDisplayInline=true}}
-    {{#> masthead-main}}
-      masthead main
-    {{/masthead-main}}
-    {{#> masthead-content}}
-      masthead content
-    {{/masthead-content}}
-  {{/masthead}}
   {{#> compass-container}}
+    {{#> masthead masthead--IsDisplayInline=true}}
+      {{#> masthead-main}}
+        masthead main
+      {{/masthead-main}}
+      {{#> masthead-content}}
+        masthead content
+      {{/masthead-content}}
+    {{/masthead}}
     {{#> compass-dock}}
       dock
     {{/compass-dock}}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/patternfly/components/Compass/examples/Compass.md` around lines 60 - 84,
The example places the masthead outside compass-container so the docked styles
on compass (compass--HasDock=true) don’t apply; move the entire masthead block
(the {{#> masthead ...}} ... {{/masthead}} section) so it is a direct child
inside the {{#> compass-container}} block (i.e., place masthead before or after
{{#> compass-dock}} but nested within {{#> compass-container}}) so the selector
targeting .pf-v6-c-compass__container.pf-m-docked > .pf-v6-c-masthead matches.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/patternfly/components/Compass/examples/Compass.md`:
- Around line 60-84: The example places the masthead outside compass-container
so the docked styles on compass (compass--HasDock=true) don’t apply; move the
entire masthead block (the {{#> masthead ...}} ... {{/masthead}} section) so it
is a direct child inside the {{#> compass-container}} block (i.e., place
masthead before or after {{#> compass-dock}} but nested within {{#>
compass-container}}) so the selector targeting
.pf-v6-c-compass__container.pf-m-docked > .pf-v6-c-masthead matches.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro

Run ID: fa484469-2f36-42c4-8224-e22eae92bd55

📥 Commits

Reviewing files that changed from the base of the PR and between 75e0114 and 4c6da69.

📒 Files selected for processing (13)
  • src/patternfly/base/normalize.scss
  • src/patternfly/base/patternfly-variables.scss
  • src/patternfly/base/tokens/tokens-local-felt-glass-dark.scss
  • src/patternfly/base/tokens/tokens-local-felt-glass.scss
  • src/patternfly/base/tokens/tokens-local-glass-dark.scss
  • src/patternfly/base/tokens/tokens-local-glass.scss
  • src/patternfly/base/tokens/tokens-local.scss
  • src/patternfly/components/Compass/compass-container.hbs
  • src/patternfly/components/Compass/compass.hbs
  • src/patternfly/components/Compass/compass.scss
  • src/patternfly/components/Compass/examples/Compass.md
  • src/patternfly/demos/Compass/compass--card-view.hbs
  • src/patternfly/patternfly.scss
💤 Files with no reviewable changes (1)
  • src/patternfly/patternfly.scss

@jcmill
jcmill force-pushed the feat/8287-glass-theme-background branch from 0c6d117 to 5645dde Compare May 5, 2026 17:23
jcmill added 6 commits May 5, 2026 16:55
… styles stemming from compass and appropriate modifier classes, move token from pf-variables file to correct local file, remove specific language from docs, cleanup unintended ai interference
… removed with the removal of the backgrounds
Comment thread src/patternfly/components/Compass/compass.scss 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 51e0dcc into patternfly:main May 12, 2026
5 checks passed
@patternfly-build

Copy link
Copy Markdown
Collaborator

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

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.

default glass theme background image update

3 participants