← 输入框|github.com|刷新
Skip to content

chore: update glass/felt workspace background images - #8319

Merged
kmcfaul merged 3 commits into
patternfly:mainfrom
mcoker:issue-8287
Apr 17, 2026
Merged

kmcfaul merged 3 commits into
patternfly:mainfrom
mcoker:issue-8287

Conversation

@mcoker

@mcoker mcoker commented Apr 16, 2026 •

Copy link
Copy Markdown
Contributor

towards #8287.

This just updates the existing styles. For #8287 I think we need to come up with a strategy for delivering the background image.

  • Can we use the background image component?
  • Should we provide snippets of CSS for setting the background image for various themes?
  • Should compass support props for the background image, or should those be removed in favor of one of the first two bullets?

Summary by CodeRabbit

  • Style
    • Refreshed background imagery for glass and Red Hat themes with updated SVG assets
    • Improved theme scoping so background images apply consistently to the page and components
    • Updated compass component to rely on theme-driven background images (removed redundant inline wallpaper injection)

@coderabbitai

coderabbitai Bot commented Apr 16, 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: e271da73-9064-415c-990e-4e114e6134e6

📥 Commits

Reviewing files that changed from the base of the PR and between 3042184 and 68dc7b8.

📒 Files selected for processing (1)
  • src/patternfly/patternfly.scss

Walkthrough

Removed compass-specific wallpaper CSS variables from the demo template and reorganized glass-theme scoping and background-image rules in the main SCSS, adding theme-aware compass background rules and redhat overrides while removing some overflow and login background rules.

Changes

Cohort / File(s) Summary
Demo Template
src/patternfly/demos/Compass/compass--demo-context.hbs
Removed the compass--attribute wrapper that injected CSS custom properties for compass wallpaper (--pf-v6-c-compass--BackgroundImage--light, --pf-v6-c-compass--BackgroundImage--dark).
Theme Stylesheet
src/patternfly/patternfly.scss
Re-scoped glass theme selectors to :root:where(.pf-v6-theme-glass), moved background-image rules to target body, replaced login/compass background assets with generic SVGs and added redhat overrides, introduced .pf-v6-c-compass theme-aware background rules, and removed glass-scope overflow rules.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

released on @prerelease``

Suggested reviewers

  • srambach
  • thatblindgeye
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'chore: update glass/felt workspace background images' follows conventional commit format with a type prefix and descriptive message.

✏️ 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.

@patternfly-build

patternfly-build commented Apr 16, 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

🧹 Nitpick comments (1)
src/patternfly/patternfly.scss (1)

8-55: Recommended refactor: deduplicate the four image URLs and the shared background shorthand.

The same four SVG paths (PF-Bkg-Generic-Light/Dark.svg, Felt-Bkg-Generic-Light/Dark.svg) appear in both the glass-scoped login/body block and the new compass block, and the background-repeat / attachment / position / size set is duplicated as well. If any path or shorthand value ever changes, all occurrences must be kept in sync by hand.

Consider extracting the URLs into SCSS variables (or the theme-pair into a small mixin) so the asset paths live in one place. Entirely optional, but would make future asset renames or token adoption noticeably easier.

♻️ Example: SCSS variables for the asset paths
+$pf-bkg-generic-light: url("./assets/images/PF-Bkg-Generic-Light.svg");
+$pf-bkg-generic-dark:  url("./assets/images/PF-Bkg-Generic-Dark.svg");
+$pf-felt-generic-light: url("./assets/images/Felt-Bkg-Generic-Light.svg");
+$pf-felt-generic-dark:  url("./assets/images/Felt-Bkg-Generic-Dark.svg");
+
 :root:where(.pf-v6-theme-glass) {
   .pf-v6-c-login, body {
-    background-image: url("./assets/images/PF-Bkg-Generic-Light.svg");
+    background-image: $pf-bkg-generic-light;
     ...
   }
   ...
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/patternfly/patternfly.scss` around lines 8 - 55, The SCSS duplicates four
image URLs and the background shorthand across the
:root:where(.pf-v6-theme-glass) block (selectors .pf-v6-c-login, body) and the
.pf-v6-c-compass block; extract the four asset paths into SCSS variables (e.g.
$pf-bkg-generic-light, $pf-bkg-generic-dark, $felt-bkg-generic-light,
$felt-bkg-generic-dark) and create a small mixin (e.g. `@mixin` apply-bg($url) {
background-image: url($url); background-repeat: no-repeat;
background-attachment: fixed; background-position: center; background-size:
cover; }) then replace the repeated background declarations in the theme
variants inside :root:where(.pf-v6-theme-glass) (and its
&:where(.pf-v6-theme-dark/.pf-v6-theme-redhat etc) children) and in
.pf-v6-c-compass theme-specific nested rules with calls to the mixin using the
new variables.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/patternfly/patternfly.scss`:
- Around line 37-55: The .pf-v6-c-compass rule is currently applying hardcoded
background-image values unscoped to glass theme and bypasses the component's
custom properties; update this so the wallpaper is driven by the compass tokens
and only applied for the intended theme: remove direct background-image
declarations from the .pf-v6-c-compass block and instead set the token values
--pf-v6-c-compass--BackgroundImage--light and
--pf-v6-c-compass--BackgroundImage--dark (and the aggregated
--pf-v6-c-compass--BackgroundImage variable if used) inside the same theme
scoping used for login/body (e.g. :root:where(.pf-v6-theme-glass) & and the
dark/redhat variants), ensuring .pf-v6-c-compass uses
var(--pf-v6-c-compass--BackgroundImage) as the component expects.

---

Nitpick comments:
In `@src/patternfly/patternfly.scss`:
- Around line 8-55: The SCSS duplicates four image URLs and the background
shorthand across the :root:where(.pf-v6-theme-glass) block (selectors
.pf-v6-c-login, body) and the .pf-v6-c-compass block; extract the four asset
paths into SCSS variables (e.g. $pf-bkg-generic-light, $pf-bkg-generic-dark,
$felt-bkg-generic-light, $felt-bkg-generic-dark) and create a small mixin (e.g.
`@mixin` apply-bg($url) { background-image: url($url); background-repeat:
no-repeat; background-attachment: fixed; background-position: center;
background-size: cover; }) then replace the repeated background declarations in
the theme variants inside :root:where(.pf-v6-theme-glass) (and its
&:where(.pf-v6-theme-dark/.pf-v6-theme-redhat etc) children) and in
.pf-v6-c-compass theme-specific nested rules with calls to the mixin using the
new variables.
🪄 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: 6656b43d-1ed0-49a3-b6eb-ca87888c214a

📥 Commits

Reviewing files that changed from the base of the PR and between 629b06d and 3042184.

⛔ Files ignored due to path filters (4)
  • src/patternfly/assets/images/Felt-Bkg-Generic-Dark.svg is excluded by !**/*.svg
  • src/patternfly/assets/images/Felt-Bkg-Generic-Light.svg is excluded by !**/*.svg
  • src/patternfly/assets/images/PF-Bkg-Generic-Dark.svg is excluded by !**/*.svg
  • src/patternfly/assets/images/PF-Bkg-Generic-Light.svg is excluded by !**/*.svg
📒 Files selected for processing (2)
  • src/patternfly/demos/Compass/compass--demo-context.hbs
  • src/patternfly/patternfly.scss
💤 Files with no reviewable changes (1)
  • src/patternfly/demos/Compass/compass--demo-context.hbs

Comment on lines +37 to 55
.pf-v6-c-compass {
background-image: url("./assets/images/PF-Bkg-Generic-Light.svg");
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center;
background-size: cover;

:root:where(.pf-v6-theme-dark) & {
background-image: url("./assets/images/PF-Bkg-Generic-Dark.svg");
}

:root:where(.pf-v6-theme-redhat) & {
background-image: url("./assets/images/Felt-Bkg-Generic-Light.svg");
}

// stylelint-disable-next-line
#page-sidebar {
overflow: auto;
:root:where(.pf-v6-theme-redhat.pf-v6-theme-dark) & {
background-image: url("./assets/images/Felt-Bkg-Generic-Dark.svg");
}
// stylelint-enable-next-line
}

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.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# First, let's find and examine the compass.scss file
fd -t f "compass.scss" -x cat -n {}

Repository: patternfly/patternfly

Length of output: 15510


🏁 Script executed:

# Also look for the compass directory structure
fd -t d "compass" | head -20

Repository: patternfly/patternfly

Length of output: 193


🏁 Script executed:

# Search for compass custom properties mentioned in the review
rg "pf-v6-c-compass--BackgroundImage" -A 2 -B 2

Repository: patternfly/patternfly

Length of output: 47


🏁 Script executed:

# Look at the full patternfly.scss file to understand context
cat -n src/patternfly/patternfly.scss | head -60

Repository: patternfly/patternfly

Length of output: 2244


Confirm whether .pf-v6-c-compass backgrounds should apply unconditionally across all themes, and consider using compass custom properties for theming.

  1. Unscoped selector applies compass backgrounds globally. The .pf-v6-c-compass block is not nested under :root:where(.pf-v6-theme-glass), unlike the login/body rules above it (lines 8–35). This means the compass component will display these backgrounds in default, dark, and redhat themes regardless of whether glass mode is active. If compass is meant to always render with a wallpaper across all themes, this is fine—but given the PR's framing around glass/felt workspace styling, clarify whether this unconditional scoping is intentional.

  2. Hardcoding bypasses the compass custom-property system. The compass.scss file defines --pf-v6-c-compass--BackgroundImage--light and --pf-v6-c-compass--BackgroundImage--dark (both default to none), and the component itself uses var(--pf-v6-c-compass--BackgroundImage) to apply backgrounds. Setting background-image: url(...) directly in the patternfly stylesheet bypasses this contract and makes it harder for consumers to override via the documented tokens. Setting the custom properties instead would keep theming centralized in the component.

♻️ Sketch: drive compass theming through its custom properties
 .pf-v6-c-compass {
-  background-image: url("./assets/images/PF-Bkg-Generic-Light.svg");
+  --pf-v6-c-compass--BackgroundImage--light: url("./assets/images/PF-Bkg-Generic-Light.svg");
+  --pf-v6-c-compass--BackgroundImage--dark: url("./assets/images/PF-Bkg-Generic-Dark.svg");
+  background-image: var(--pf-v6-c-compass--BackgroundImage);
   background-repeat: no-repeat;
   background-attachment: fixed;
   background-position: center;
   background-size: cover;

-  :root:where(.pf-v6-theme-dark) & {
-    background-image: url("./assets/images/PF-Bkg-Generic-Dark.svg");
-  }
-
   :root:where(.pf-v6-theme-redhat) & {
-    background-image: url("./assets/images/Felt-Bkg-Generic-Light.svg");
+    --pf-v6-c-compass--BackgroundImage--light: url("./assets/images/Felt-Bkg-Generic-Light.svg");
+    --pf-v6-c-compass--BackgroundImage--dark: url("./assets/images/Felt-Bkg-Generic-Dark.svg");
   }
-
-  :root:where(.pf-v6-theme-redhat.pf-v6-theme-dark) & {
-    background-image: url("./assets/images/Felt-Bkg-Generic-Dark.svg");
-  }
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/patternfly/patternfly.scss` around lines 37 - 55, The .pf-v6-c-compass
rule is currently applying hardcoded background-image values unscoped to glass
theme and bypasses the component's custom properties; update this so the
wallpaper is driven by the compass tokens and only applied for the intended
theme: remove direct background-image declarations from the .pf-v6-c-compass
block and instead set the token values --pf-v6-c-compass--BackgroundImage--light
and --pf-v6-c-compass--BackgroundImage--dark (and the aggregated
--pf-v6-c-compass--BackgroundImage variable if used) inside the same theme
scoping used for login/body (e.g. :root:where(.pf-v6-theme-glass) & and the
dark/redhat variants), ensuring .pf-v6-c-compass uses
var(--pf-v6-c-compass--BackgroundImage) as the component expects.

@mcoker
mcoker requested review from kmcfaul and lboehling April 16, 2026 20:24

@lboehling lboehling left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nice!

@kmcfaul
kmcfaul merged commit c684f88 into patternfly:main Apr 17, 2026
5 checks passed
@patternfly-build

Copy link
Copy Markdown
Collaborator

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

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.

4 participants