Skip to content

Build your personal knowledge base with Trilium Notes

fix(office): draw spreadsheet gridlines in XLSX previews

Elian Doranbe1cd6c731dd
diff --git a/apps/client/src/services/content_renderer.css b/apps/client/src/services/content_renderer.css
index bdde3cfa0f..d0fca253bc 100644
--- a/apps/client/src/services/content_renderer.css
+++ b/apps/client/src/services/content_renderer.css
@@ -75,3 +75,30 @@
flex-grow: 1;
}
}
+
+/* Companion styles for the native spreadsheet renderer used by XLSX previews. The
+ renderer emits classed markup (spreadsheet-table / show-gridlines / has-fill) and
+ relies on each host to provide these rules — share-theme and print.css carry their
+ own copies; these mirror the share-theme semantics (see its comments for the why
+ of every rule, notably gridlines-as-borders and the fixed layout). */
+.office-preview-body .spreadsheet-table {
+ border-collapse: collapse;
+ width: auto;
+ margin-top: 1em;
+ table-layout: fixed;
+}
+
+.office-preview-body .spreadsheet-table td {
+ padding: 2px 4px;
+ white-space: nowrap;
+ overflow: visible;
+}
+
+.office-preview-body .spreadsheet-table.show-gridlines td:not(.has-fill) {
+ border: 1px solid var(--spreadsheet-gridline-color, var(--main-border-color));
+}
+
+.office-preview-body .spreadsheet-sheet {
+ font-size: 11pt;
+ line-height: 1.2;
+}