Skip to content

Rework frozen column shadow#3969

Open
nstepien wants to merge 9 commits intomainfrom
frozenshadow
Open

Rework frozen column shadow#3969
nstepien wants to merge 9 commits intomainfrom
frozenshadow

Conversation

@nstepien
Copy link
Collaborator

@nstepien nstepien commented Feb 22, 2026

Before

Borders would increase the layer size (in devtools: "show layer borders"), and bleed onto other rows. They'd also be slightly round, instead of being uniform vertically. box-shadow may also impact browser rendering performance, haven't checked though.
I've maxed out the shadow's color opacity in the second screenshot so it's easier to tell.

image image

After

No overlapping layers, uniform shadows, and thanks to container queries: no shadow if we're at scrollable: inline-start 👍
I've also tweaked the shadow so it looks more like a shadow than before.

image image image

@codecov-commenter
Copy link

codecov-commenter commented Feb 27, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.55%. Comparing base (a80e036) to head (1d7799d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3969      +/-   ##
==========================================
+ Coverage   97.53%   97.55%   +0.01%     
==========================================
  Files          36       36              
  Lines        1463     1473      +10     
  Branches      472      481       +9     
==========================================
+ Hits         1427     1437      +10     
  Misses         36       36              
Files with missing lines Coverage Δ
src/DataGrid.tsx 99.00% <100.00%> (+0.02%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

transition: opacity 0.1s;

/* TODO: reverse 'opacity' and remove 'not' */
@container rdg-root not scroll-state(scrollable: inline-start) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Firefox/Safari will always show the shadow until they support scroll-state container queries.
https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/container-type

Comment on lines +97 to +102
width: 10px;
background-image: linear-gradient(
to right,
light-dark(rgb(0 0 0 / 15%), rgb(0 0 0 / 40%)),
transparent
);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The shadow is wider/stronger than before, let me know if you think we should tweak it.

)}
</DataGridDefaultRenderersContext>

{lastFrozenColumnIndex > -1 && (
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the best way I found to make it work in all scenarios, including column grouping.

@nstepien nstepien marked this pull request as ready for review February 27, 2026 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants