Repository navigation
chore: update glass/felt workspace background images - #8319
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughRemoved 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ 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. Comment |
|
Preview: https://pf-pr-8319.surge.sh A11y report: https://pf-pr-8319-a11y.surge.sh |
There was a problem hiding this comment.
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 thebackground-repeat / attachment / position / sizeset 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
⛔ Files ignored due to path filters (4)
src/patternfly/assets/images/Felt-Bkg-Generic-Dark.svgis excluded by!**/*.svgsrc/patternfly/assets/images/Felt-Bkg-Generic-Light.svgis excluded by!**/*.svgsrc/patternfly/assets/images/PF-Bkg-Generic-Dark.svgis excluded by!**/*.svgsrc/patternfly/assets/images/PF-Bkg-Generic-Light.svgis excluded by!**/*.svg
📒 Files selected for processing (2)
src/patternfly/demos/Compass/compass--demo-context.hbssrc/patternfly/patternfly.scss
💤 Files with no reviewable changes (1)
- src/patternfly/demos/Compass/compass--demo-context.hbs
| .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 | ||
| } |
There was a problem hiding this comment.
🧩 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 -20Repository: 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 2Repository: 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 -60Repository: 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.
-
Unscoped selector applies compass backgrounds globally. The
.pf-v6-c-compassblock 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. -
Hardcoding bypasses the compass custom-property system. The
compass.scssfile defines--pf-v6-c-compass--BackgroundImage--lightand--pf-v6-c-compass--BackgroundImage--dark(both default tonone), and the component itself usesvar(--pf-v6-c-compass--BackgroundImage)to apply backgrounds. Settingbackground-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.
|
🎉 This PR is included in version 6.5.0-prerelease.74 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Summary by CodeRabbit