refactor(print): use dedicated print CSS

This commit is contained in:
Elian Doran 2025-01-31 20:47:18 +02:00
parent 561c50706e
commit 298634ceaa
No known key found for this signature in database
4 changed files with 99 additions and 101 deletions

View File

@ -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%);
}

View File

@ -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%);
}
}

View File

@ -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();

View File

@ -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">