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

fix: make plain and no-plain-on-glass work together - #8266

Merged
mcoker merged 4 commits into
patternfly:mainfrom
mcoker:issue-8256
Apr 13, 2026
Merged

mcoker merged 4 commits into
patternfly:mainfrom
mcoker:issue-8256

Conversation

@mcoker

@mcoker mcoker commented Apr 1, 2026 •

Copy link
Copy Markdown
Contributor

fixes #8256
fixes #8267

Summary by CodeRabbit

  • Style
    • Refined CSS selector logic for accordion, data list, and drawer components to improve theme handling consistency, particularly for the glass theme variant.

@coderabbitai

coderabbitai Bot commented Apr 1, 2026 •

Copy link
Copy Markdown
Contributor

Walkthrough

Modified SCSS selectors across Accordion, DataList, and Drawer components to explicitly gate background styling based on the root pf-v6-theme-glass class presence. Replaced @at-root combined selectors with explicit :where(:root ...) conditions to control when plain variant styling applies relative to glass theme mode.

Changes

Cohort / File(s) Summary
Plain variant glass theme handling
src/patternfly/components/Accordion/accordion.scss, src/patternfly/components/DataList/data-list.scss
Refactored CSS selector structure from @at-root :where(.pf-v6-theme-glass) &:not(.pf-m-no-plain-on-glass), &.pf-m-plain to dual explicit root-scoped rules: :where(:root:not(.pf-v6-theme-glass)) &.pf-m-plain and :where(:root.pf-v6-theme-glass) &:not(.pf-m-no-plain-on-glass). Ensures proper precedence of .pf-m-no-plain-on-glass over .pf-m-plain in glass theme context.
Drawer glass and plain styling
src/patternfly/components/Drawer/drawer.scss
Narrowed glass styling selector to directly target panel element with .pf-m-glass class; updated plain background handling to use CSS variable --pf__panel--BackgroundColor: transparent with root-scoped theme condition rather than direct background: transparent property.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

  • #8256: Directly addresses the core objective of ensuring .pf-m-no-plain-on-glass takes precedence over .pf-m-plain in glass theme mode, which the selector refactoring in this PR implements.

Possibly related PRs

Suggested labels

released on @prerelease``

Suggested reviewers

  • thatblindgeye
  • srambach
🚥 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 follows conventional commit guidelines with 'fix:' prefix and clearly describes the main change of resolving the precedence issue between plain and no-plain-on-glass modifiers.
Linked Issues check ✅ Passed The PR successfully addresses the linked issue #8256 by refactoring CSS selectors across Accordion, DataList, and Drawer components to ensure .pf-m-no-plain-on-glass takes precedence over .pf-m-plain in glass theme contexts.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing the precedence logic of plain and no-plain-on-glass modifiers in three affected components' SCSS files, with no extraneous modifications.

✏️ 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 1, 2026 •

Copy link
Copy Markdown
Collaborator

@thatblindgeye

Copy link
Copy Markdown
Contributor

Just to note, once this PR merges and we open a core bump PR in React, we want to double check the following React PRs/components work correctly with the updates in this PR:

@jcmill jcmill left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🧹 anything I have for the plain and no-plain selector set is not any cleaner than what you have.

@jcmill
jcmill marked this pull request as ready for review April 9, 2026 13:31

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

📥 Commits

Reviewing files that changed from the base of the PR and between 483890b and cef70cb.

📒 Files selected for processing (3)
  • src/patternfly/components/Accordion/accordion.scss
  • src/patternfly/components/DataList/data-list.scss
  • src/patternfly/components/Drawer/drawer.scss

Comment on lines +660 to +663
> .#{$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;

@coderabbitai coderabbitai Bot Apr 9, 2026 •

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 | 🟠 Major

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.

Suggested change
> .#{$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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Also seeing this bug @thatblindgeye

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.

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!

@jcmill
jcmill self-requested a review April 9, 2026 13:36

@jcmill jcmill left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🫧

@jcmill jcmill left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@mcoker mcoker left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

One comment about the drawer, with both classes it's always plain

Comment on lines +660 to +663
> .#{$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;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Also seeing this bug @thatblindgeye

@mcoker mcoker left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Well done @thatblindgeye 👏

@mcoker
mcoker merged commit 88f8b35 into patternfly:main Apr 13, 2026
5 checks passed
@mcoker
mcoker deleted the issue-8256 branch April 13, 2026 01:40
@patternfly-build

Copy link
Copy Markdown
Collaborator

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

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 - drawer - move pf-m-plain/glass/no-plain-on-glass to the drawer panel Bug - Handle plain and no-plain-on-glass appropriately

4 participants