Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(quill): stop scroll edges restyling every table cell (#128615)

Adam Leith6e3b52414870
diff --git a/packages/quill/packages/primitives/src/table.css b/packages/quill/packages/primitives/src/table.css
index 11da1c521d0c..b19cb1442922 100644
--- a/packages/quill/packages/primitives/src/table.css
+++ b/packages/quill/packages/primitives/src/table.css
@@ -11,12 +11,6 @@
--tbl-edge-shadow: rgb(0 0 0 / 12%);
--tbl-row-hover: color-mix(in oklab, var(--muted) 40%, var(--background));
- /* Generic viewport-edge shadows, toggled per edge below. */
- --tbl-shadow-top: 0 0 0 0 transparent;
- --tbl-shadow-right: 0 0 0 0 transparent;
- --tbl-shadow-bottom: 0 0 0 0 transparent;
- --tbl-shadow-left: 0 0 0 0 transparent;
-
position: relative;
width: 100%;
@@ -57,6 +51,14 @@
viewport edge; on the root (non-scrolling) they stay put while scrolling. */
.quill-table__root::before,
.quill-table__root::after {
+ /* Generic viewport-edge shadows, toggled per edge below. They live on the pseudos and not
+ the root, because a custom property on the root is inherited by every cell, and changing
+ it restyles all of them. That is a long freeze in a large table. */
+ --tbl-shadow-top: 0 0 0 0 transparent;
+ --tbl-shadow-right: 0 0 0 0 transparent;
+ --tbl-shadow-bottom: 0 0 0 0 transparent;
+ --tbl-shadow-left: 0 0 0 0 transparent;
+
position: absolute;
inset: 0;
z-index: 4;
@@ -78,21 +80,21 @@
shadow when one exists (it sits beside the frozen edge, not over it). */
.quill-table__root[data-scroll-right]:not(
:has(.quill-table__cell[data-sticky='right'], .quill-table__head[data-sticky='right'])
- ) {
+ )::after {
--tbl-shadow-right: inset -16px 0 16px -16px var(--tbl-edge-shadow);
}
- .quill-table__root[data-scroll-bottom] {
+ .quill-table__root[data-scroll-bottom]::after {
--tbl-shadow-bottom: inset 0 -16px 16px -16px var(--tbl-edge-shadow);
}
.quill-table__root[data-scroll-left]:not(
:has(.quill-table__cell[data-sticky='left'], .quill-table__head[data-sticky='left'])
- ) {
+ )::before {
--tbl-shadow-left: inset 16px 0 16px -16px var(--tbl-edge-shadow);
}
- .quill-table__root[data-scroll-top]:not(:has(.quill-table[data-sticky-header])) {
+ .quill-table__root[data-scroll-top]:not(:has(.quill-table[data-sticky-header]))::before {
--tbl-shadow-top: inset 0 16px 16px -16px var(--tbl-edge-shadow);
}