Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
refactor(print): use dedicated print CSS
Elian Doran298634ceaa6b
diff --git a/src/public/stylesheets/print.css b/src/public/stylesheets/print.cssindex e69de29bb2..b02522d45c 100644--- a/src/public/stylesheets/print.css+++ b/src/public/stylesheets/print.css@@ -0,0 +1,97 @@+.no-print,+.no-print *,+.tab-row-container,+#launcher-pane,+#left-pane,+#right-pane,+.title-row .note-icon-widget,+.title-row .button-widget,+.ribbon-container,+.scroll-padding-widget,+.spacer {+ display: none !important;+}++body,+#root-widget,+#rest-pane > div.component:first-child,+.note-detail-printable,+.note-detail-editable-text-editor {+ height: unset !important;+ overflow: auto;+}++.note-title-widget input,+.note-detail-editable-text,+.note-detail-editable-text-editor {+ padding: 0 !important;+}++html,+body {+ height: unset !important;+ overflow: visible;+ position: unset;+ /* https://github.com/zadam/trilium/issues/3202 */+ color: black;+}++#root-widget,+#horizontal-main-container,+#rest-pane,+#vertical-main-container,+#center-pane,+.split-note-container-widget,+.note-split:not(.hidden-ext) {+ display: block !important;+ overflow: auto;+}++#rest-pane,+.note-split {+ width: 100% !important;+ max-width: unset !important;+}++.component {+ contain: none !important;+}++/* Respect page breaks */+.page-break {+ page-break-after: always;+ break-after: always;+}++.page-break > * {+ display: none !important;+}++.relation-map-wrapper {+ height: 100vh !important;+}++.table thead th,+.table td,+.table th {+ /* Fix center vertical alignment of table cells */+ vertical-align: middle;+}++pre {+ box-shadow: unset !important;+ border: 0.75pt solid gray !important;+ border-radius: 2pt !important;+}++span[style] {+ print-color-adjust: exact;+ -webkit-print-color-adjust: exact;+}++/* Fix visibility of checkbox checkmarks+ see https://github.com/TriliumNext/Notes/issues/901 */+.ck-editor__editable.ck-content .todo-list .todo-list__label > span[contenteditable="false"] > input[checked]::after {+ /* fallback to default ck-editor green */+ border-color: hsl(126, 64%, 41%);+}\ No newline at end of filediff --git a/src/public/stylesheets/style.css b/src/public/stylesheets/style.cssindex 284e5afe37..8f883d8ffa 100644--- a/src/public/stylesheets/style.css+++ b/src/public/stylesheets/style.css@@ -1604,105 +1604,4 @@ body.electron.platform-darwin:not(.native-titlebar) .tab-row-container {border-color: var(--hover-item-border-color);background: var(--hover-item-background-color);color: var(--hover-item-text-color);-}--@media print {- .no-print,- .no-print *,- .tab-row-container,- #launcher-pane,- #left-pane,- #right-pane,- .title-row .note-icon-widget,- .title-row .button-widget,- .ribbon-container,- .scroll-padding-widget,- .spacer {- display: none !important;- }-- body,- #root-widget,- #rest-pane > div.component:first-child,- .note-detail-printable,- .note-detail-editable-text-editor {- height: unset !important;- overflow: auto;- }-- .note-title-widget input,- .note-detail-editable-text,- .note-detail-editable-text-editor {- padding: 0 !important;- }-- html,- body {- height: unset !important;- overflow: visible;- position: unset;- /* https://github.com/zadam/trilium/issues/3202 */- color: black;- }-- #root-widget,- #horizontal-main-container,- #rest-pane,- #vertical-main-container,- #center-pane,- .split-note-container-widget,- .note-split:not(.hidden-ext) {- display: block !important;- overflow: auto;- }-- #rest-pane,- .note-split {- width: 100% !important;- max-width: unset !important;- }-- .component {- contain: none !important;- }-- /* Respect page breaks */- .page-break {- page-break-after: always;- break-after: always;- }-- .page-break > * {- display: none !important;- }-- .relation-map-wrapper {- height: 100vh !important;- }-- .table thead th,- .table td,- .table th {- /* Fix center vertical alignment of table cells */- vertical-align: middle;- }-- pre {- box-shadow: unset !important;- border: 0.75pt solid gray !important;- border-radius: 2pt !important;- }-- span[style] {- print-color-adjust: exact;- -webkit-print-color-adjust: exact;- }-- /* Fix visibility of checkbox checkmarks- see https://github.com/TriliumNext/Notes/issues/901 */- .ck-editor__editable.ck-content .todo-list .todo-list__label > span[contenteditable="false"] > input[checked]::after {- /* fallback to default ck-editor green */- border-color: hsl(126, 64%, 41%);- }-}\ No newline at end of filediff --git a/src/views/desktop.ejs b/src/views/desktop.ejsindex aa325834df..da74e65c8c 100644--- a/src/views/desktop.ejs+++ b/src/views/desktop.ejs@@ -62,6 +62,7 @@<% } %><link href="<%= assetPath %>/stylesheets/style.css" rel="stylesheet">+<link href="<%= assetPath %>/stylesheets/print.css" rel="stylesheet" media="print"><script>$("body").show();diff --git a/src/views/mobile.ejs b/src/views/mobile.ejsindex f40211efee..bcd712d28c 100644--- a/src/views/mobile.ejs+++ b/src/views/mobile.ejs@@ -129,6 +129,7 @@<link href="<%= themeCssUrl %>" rel="stylesheet"><% } %><link href="<%= assetPath %>/stylesheets/style.css" rel="stylesheet">+<link href="<%= assetPath %>/stylesheets/print.css" rel="stylesheet" media="print"><link rel="stylesheet" type="text/css" href="<%= assetPath %>/node_modules/boxicons/css/boxicons.min.css">