fix: arbitrary colors in dark mode

This commit is contained in:
Philipinho
2026-08-11 14:32:28 +01:00
parent 2fe13daa09
commit 228fe14cd8
3 changed files with 12 additions and 2 deletions
@@ -86,6 +86,16 @@
.ProseMirror {
table {
@mixin dark {
/* Arbitrary (imported) colors: derive a dark variant; the hand-tuned
palette rules below override this for native colors. */
td[data-background-color],
th[data-background-color] {
background-color: oklch(
from var(--cell-bg, #fff) min(l, clamp(0.28, calc(1.22 - l), 0.45))
min(calc(c * 1.8), 0.09) h
) !important;
}
/* Blue */
td[data-background-color="#b4d5ff"],
th[data-background-color="#b4d5ff"] {
+1 -1
View File
@@ -19,7 +19,7 @@ export const TableCell = TiptapTableCell.extend({
return {};
}
return {
style: `background-color: ${attributes.backgroundColor}`,
style: `background-color: ${attributes.backgroundColor}; --cell-bg: ${attributes.backgroundColor}`,
"data-background-color": attributes.backgroundColor,
};
},
+1 -1
View File
@@ -19,7 +19,7 @@ export const TableHeader = TiptapTableHeader.extend({
return {};
}
return {
style: `background-color: ${attributes.backgroundColor}`,
style: `background-color: ${attributes.backgroundColor}; --cell-bg: ${attributes.backgroundColor}`,
"data-background-color": attributes.backgroundColor,
};
},