Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix: fix table styles in tiptap

thecodrr74cb3f37194b
diff --git a/apps/web/src/components/editor/tiptap.css b/apps/web/src/components/editor/tiptap.css
index 738e1a75a..e496bcb73 100644
--- a/apps/web/src/components/editor/tiptap.css
+++ b/apps/web/src/components/editor/tiptap.css
@@ -90,9 +90,11 @@ img.ProseMirror-separator {
}
.ProseMirror-hideselection *::selection {
background: transparent;
+ color: var(--text);
}
.ProseMirror-hideselection *::-moz-selection {
background: transparent;
+ color: var(--text);
}
.ProseMirror-hideselection * {
caret-color: transparent;
@@ -103,3 +105,68 @@ img.ProseMirror-separator {
.tippy-box[data-animation="fade"][data-state="hidden"] {
opacity: 0;
}
+
+.ProseMirror table {
+ border-collapse: collapse;
+ margin: 0;
+ overflow: hidden;
+ table-layout: fixed;
+}
+
+.ProseMirror table td,
+.ProseMirror table th {
+ border: 1px solid var(--border);
+ box-sizing: border-box;
+ min-width: 1em;
+ padding: 3px 5px;
+ position: relative;
+ vertical-align: top;
+}
+
+.ProseMirror table td > *,
+.ProseMirror table th > * {
+ margin-bottom: 0;
+}
+
+.ProseMirror table th {
+ background-color: var(--bgSecondary);
+ font-weight: bold;
+ text-align: left;
+}
+
+.ProseMirror table .selectedCell:after {
+ background: var(--primary);
+ content: "";
+ left: 0;
+ right: 0;
+ top: 0;
+ bottom: 0;
+ pointer-events: none;
+ position: absolute;
+ z-index: 2;
+ opacity: 0.2;
+}
+
+.ProseMirror table .column-resize-handle {
+ background-color: var(--primary);
+ bottom: -2px;
+ position: absolute;
+ right: -2px;
+ pointer-events: none;
+ top: 0;
+ width: 5px;
+}
+
+.ProseMirror table p {
+ margin: 0;
+}
+
+.tableWrapper {
+ padding: 1rem 0;
+ overflow-x: auto;
+}
+
+.resize-cursor {
+ cursor: ew-resize;
+ cursor: col-resize;
+}