Repository navigation
fix: make plain and no-plain-on-glass work together - #8266
Conversation
WalkthroughModified SCSS selectors across Accordion, DataList, and Drawer components to explicitly gate background styling based on the root Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 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-8266.surge.sh A11y report: https://pf-pr-8266-a11y.surge.sh |
jcmill
left a comment
There was a problem hiding this comment.
🧹 anything I have for the plain and no-plain selector set is not any cleaner than what you have.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/components/Drawer/drawer.scss`:
- Around line 660-663: The selector currently lets .pf-m-plain unconditionally
override glass exceptions; update the selector so .pf-m-plain does not apply
when .pf-m-no-plain-on-glass is present (e.g. change the second selector branch
&.pf-m-plain to exclude .pf-m-no-plain-on-glass such as
&.pf-m-plain:not(.pf-m-no-plain-on-glass)) inside the ".#{$drawer}__main >
.#{$drawer}__panel" rule so that in glass mode the :not(.pf-m-no-plain-on-glass)
precedence is respected.
🪄 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: 36a75460-c936-4eb1-81f6-cf253fff65d0
📒 Files selected for processing (3)
src/patternfly/components/Accordion/accordion.scsssrc/patternfly/components/DataList/data-list.scsssrc/patternfly/components/Drawer/drawer.scss
| > .#{$drawer}__main > .#{$drawer}__panel { | ||
| @at-root :where(.pf-v6-theme-glass) &:not(.pf-m-no-plain-on-glass), | ||
| &.pf-m-plain { | ||
| --#{$drawer}__panel--BackgroundColor: transparent; |
There was a problem hiding this comment.
pf-m-no-plain-on-glass still loses to pf-m-plain in glass mode.
The unconditional &.pf-m-plain branch still applies in glass, so a panel with both modifiers can still be forced transparent. That conflicts with the precedence expected by this PR objective.
Suggested selector fix
- `@at-root` :where(.pf-v6-theme-glass) &:not(.pf-m-no-plain-on-glass),
- &.pf-m-plain {
+ `@at-root` :where(:root:not(.pf-v6-theme-glass)) &.pf-m-plain,
+ :where(:root.pf-v6-theme-glass) &:not(.pf-m-no-plain-on-glass) {
--#{$drawer}__panel--BackgroundColor: transparent;
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| > .#{$drawer}__main > .#{$drawer}__panel { | |
| @at-root :where(.pf-v6-theme-glass) &:not(.pf-m-no-plain-on-glass), | |
| &.pf-m-plain { | |
| --#{$drawer}__panel--BackgroundColor: transparent; | |
| > .#{$drawer}__main > .#{$drawer}__panel { | |
| `@at-root` :where(:root:not(.pf-v6-theme-glass)) &.pf-m-plain, | |
| :where(:root.pf-v6-theme-glass) &:not(.pf-m-no-plain-on-glass) { | |
| --#{$drawer}__panel--BackgroundColor: transparent; |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/patternfly/components/Drawer/drawer.scss` around lines 660 - 663, The
selector currently lets .pf-m-plain unconditionally override glass exceptions;
update the selector so .pf-m-plain does not apply when .pf-m-no-plain-on-glass
is present (e.g. change the second selector branch &.pf-m-plain to exclude
.pf-m-no-plain-on-glass such as &.pf-m-plain:not(.pf-m-no-plain-on-glass))
inside the ".#{$drawer}__main > .#{$drawer}__panel" rule so that in glass mode
the :not(.pf-m-no-plain-on-glass) precedence is respected.
There was a problem hiding this comment.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
cef70cb to
3585a9d
Compare
mcoker
left a comment
There was a problem hiding this comment.
One comment about the drawer, with both classes it's always plain
| > .#{$drawer}__main > .#{$drawer}__panel { | ||
| @at-root :where(.pf-v6-theme-glass) &:not(.pf-m-no-plain-on-glass), | ||
| &.pf-m-plain { | ||
| --#{$drawer}__panel--BackgroundColor: transparent; |
mcoker
left a comment
There was a problem hiding this comment.
Well done @thatblindgeye 👏
|
🎉 This PR is included in version 6.5.0-prerelease.67 🎉 The release is available on: Your semantic-release bot 📦🚀 |
fixes #8256
fixes #8267
Summary by CodeRabbit