fix(table): table thead background issue in safari#8472
Conversation
WalkthroughThree unrelated SCSS component fixes: ChangesComponent Styling Fixes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 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 |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/patternfly/components/Page/page.scss`:
- Around line 32-33: The CSS custom property
`--#{$page}__dock-main--desktop--BorderInlineEndwidth` has incorrect casing in
the "Endwidth" portion - it should be "EndWidth" to match the standard naming
convention for BorderInlineEndWidth variables across the codebase. Since CSS
custom properties are case-sensitive, this inconsistency prevents external code
from properly overriding the property using the expected casing. Correct the
casing from "BorderInlineEndwidth" to "BorderInlineEndWidth" in both the
variable definition at lines 32-33 and also apply the same fix to the similar
properties mentioned at lines 483-484 to ensure consistency throughout the file.
In `@src/patternfly/components/Table/table.scss`:
- Around line 350-376: The `.#{$table}__th` selector applies sticky header
decoration styles too broadly to all table header cells, including non-header
`<th>` elements that may exist elsewhere in the table structure. Scope this
selector to only target `<th>` cells that are descendants of `.#{$table}__thead`
(such as using `.#{$table}__thead .#{$table}__th` or `.#{$table}__thead >
.#{$table}__th`) to ensure the sticky header pseudo-element styles and
decorations are applied only to actual header cells within the thead element.
- Around line 350-376: The new `.#{$table}__th::before` and
`.#{$table}__th::after` pseudo-element styling is being applied unconditionally,
but it should only be visible when the sticky header is in the `-stuck` state.
The existing opacity toggles that target `thead::before/::after` at lines 304
and 319 need to be extended to also apply to the `.#{$table}__th::before` and
`.#{$table}__th::after` pseudo-elements. Update those opacity toggle rules to
include selectors for the table header cell pseudo-elements so the sticky
styling respects the base/stuck state behavior contract.
🪄 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: 7e3e74bf-852b-40d0-a3b8-dd5bafd7c516
📒 Files selected for processing (3)
src/patternfly/components/Page/page.scsssrc/patternfly/components/Panel/panel.scsssrc/patternfly/components/Table/table.scss
|
Preview: https://pf-pr-8472.surge.sh A11y report: https://pf-pr-8472-a11y.surge.sh |
|
@jcmill looks like you may have created this branch from the panel/docked nav branch? Looks like the page/panel stylesheets have a conflict. |
mcoker
left a comment
There was a problem hiding this comment.
- Looks like there is a bug with nested column headers. I wonder if something like this would work?
tr:first-child {
.#{$table}__th:first-child { top/left border }
.#{$table}__th:last-child { top/right border }
}
tr:last-child {
.#{$table}__th:first-child { bottom/left border }
.#{$table}__th:last-child { bottom/right border }
}
- We still have some styles on thead:before/after and some need to be moved to the thead cells. Not an exhaustive list but here are some I found
- https://github.com/jcmill/patternfly/blob/484b66c6941a3eddb880866264673a4f28903445/src/patternfly/components/Table/table.scss#L304-L312
- https://github.com/jcmill/patternfly/blob/484b66c6941a3eddb880866264673a4f28903445/src/patternfly/components/Table/table.scss#L330-L343
- https://github.com/jcmill/patternfly/blob/484b66c6941a3eddb880866264673a4f28903445/src/patternfly/components/Table/table.scss#L1309-L1316
17cb1ff to
c8526db
Compare
Co-authored-by: Michael Coker <35148959+mcoker@users.noreply.github.com>
Co-authored-by: Michael Coker <35148959+mcoker@users.noreply.github.com>
…d column headers with sticky header
7f61d5b to
35d5cea
Compare
|
I worked on this a little and added a PR in your repo to show the code diff, although it doesn't have the last commit you just made - jcmill#1 And I created a preview at http://8453-table-thead-hidden-in-safari.surge.sh/ The CSS should fix all of the borders except in Safari with sticky, nested column headers in non-glass theme. That border appears initially, then scrolls off screen. To fix that, I've gone back to how we did that before by adding a So we would say if you have a table with 1) sticky header, and 2) nested column headers, you need a This doesn't fix the border-radius and shadow issue in Safari, but those can come later. |
…h, update border-row to height and bg color
|
🎉 This PR is included in version 6.6.0-prerelease.16 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Closes #8453
Move background and border ::before and ::after elements from thead to th for Safari support.
Summary by CodeRabbit