From dfd969084bbbdcf7b30918951ce01d7dacbe31f2 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Thu, 19 Feb 2026 21:15:07 -0500 Subject: [PATCH] fix: Sticky header transparent background (#11501) fix: Custom header color incorrect text color --- shared/editor/components/Styles.ts | 6 ++++-- shared/editor/lib/table.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/shared/editor/components/Styles.ts b/shared/editor/components/Styles.ts index a911fe5b86..d121d21a0b 100644 --- a/shared/editor/components/Styles.ts +++ b/shared/editor/components/Styles.ts @@ -1954,8 +1954,10 @@ table { padding: 4px 0; } - td[data-bgcolor] { + td[data-bgcolor], + th[data-bgcolor] { color: var(--cell-text-color); + background: linear-gradient(var(--cell-bg-color), var(--cell-bg-color)), linear-gradient(${props.theme.background}, ${props.theme.background}); p, a, p a { color: var(--cell-text-color, inherit); @@ -2287,7 +2289,7 @@ table { } .${EditorStyleHelper.tableStickyHeader} { - th { + tr:first-child th { transform: translateY(calc(var(--header-offset, 64px) + var(--sticky-scroll-offset, 0px))); border-bottom: 1px solid ${props.theme.divider}; diff --git a/shared/editor/lib/table.ts b/shared/editor/lib/table.ts index 9d04be3036..c2420733fe 100644 --- a/shared/editor/lib/table.ts +++ b/shared/editor/lib/table.ts @@ -90,7 +90,7 @@ export function setCellAttrs(node: Node): Attrs { attrs["data-bgcolor"] = backgroundMark.attrs.color; attrs.style = (attrs.style ?? "") + - `background-color: ${backgroundMark.attrs.color}; --cell-text-color: ${readableColor(backgroundMark.attrs.color)};`; + `--cell-bg-color: ${backgroundMark.attrs.color}; --cell-text-color: ${readableColor(backgroundMark.attrs.color)};`; } }