Skip to content

Commit ca0e9e1

Browse files
committed
Enhance print styles for better documentation printing
1 parent 90be967 commit ca0e9e1

File tree

1 file changed

+145
-0
lines changed

1 file changed

+145
-0
lines changed

www/assets/css/main.css

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,151 @@ code {
843843
z-index: 1;
844844
}
845845

846+
/* Print Styles */
847+
@media print {
848+
849+
/* General print styles */
850+
body {
851+
font-size: 12pt;
852+
line-height: 1.5;
853+
background: #fff;
854+
color: #000;
855+
}
856+
857+
/* Hide non-essential elements */
858+
.site-header,
859+
.site-footer,
860+
#mobile-menu,
861+
#mobile-menu-button,
862+
button {
863+
display: none !important;
864+
}
865+
866+
/* Ensure content takes full width */
867+
.container,
868+
main,
869+
.content {
870+
width: 100% !important;
871+
max-width: 100% !important;
872+
margin: 0 !important;
873+
padding: 0 !important;
874+
}
875+
876+
/* Improve link display */
877+
a {
878+
color: #000 !important;
879+
text-decoration: none !important;
880+
}
881+
882+
a[href^="http"]:after {
883+
content: " (" attr(href) ")";
884+
font-size: 90%;
885+
font-style: italic;
886+
}
887+
888+
/* Improve table display */
889+
table,
890+
th,
891+
td {
892+
border: 1px solid #ddd !important;
893+
}
894+
895+
table {
896+
page-break-inside: avoid;
897+
width: 100% !important;
898+
border-collapse: collapse;
899+
}
900+
901+
th {
902+
background-color: #f0f0f0 !important;
903+
color: #000 !important;
904+
}
905+
906+
/* Ensure code blocks print well */
907+
pre,
908+
code {
909+
background-color: #f8f8f8 !important;
910+
border: 1px solid #ddd !important;
911+
font-size: 11pt;
912+
page-break-inside: avoid;
913+
white-space: pre-wrap !important;
914+
word-wrap: break-word !important;
915+
}
916+
917+
/* Ensure diagrams print well */
918+
.diagram-container {
919+
page-break-inside: avoid;
920+
max-width: 100% !important;
921+
overflow: visible !important;
922+
}
923+
924+
.encryption-diagram {
925+
border: 1px solid #000 !important;
926+
background-color: #fff !important;
927+
color: #000 !important;
928+
max-width: 100% !important;
929+
overflow: visible !important;
930+
white-space: pre-wrap !important;
931+
}
932+
933+
/* Improve card display */
934+
.mode-card {
935+
page-break-inside: avoid;
936+
border: 1px solid #000 !important;
937+
margin-bottom: 20pt !important;
938+
padding: 10pt !important;
939+
background-color: #fff !important;
940+
}
941+
942+
/* Add page breaks before major sections */
943+
h1,
944+
h2 {
945+
page-break-before: always;
946+
page-break-after: avoid;
947+
}
948+
949+
h1:first-of-type {
950+
page-break-before: avoid;
951+
}
952+
953+
h3,
954+
h4,
955+
h5,
956+
h6 {
957+
page-break-after: avoid;
958+
}
959+
960+
/* Avoid breaking inside paragraphs and lists */
961+
p,
962+
ul,
963+
ol,
964+
dl,
965+
pre,
966+
blockquote,
967+
table,
968+
figure {
969+
page-break-inside: avoid;
970+
}
971+
972+
/* Add URL to the top of the first page */
973+
@page: first {
974+
margin-top: 3cm;
975+
}
976+
977+
body:before {
978+
content: "IPCrypt Documentation - https://ipcrypt-std.github.io/";
979+
position: absolute;
980+
top: 0;
981+
left: 0;
982+
width: 100%;
983+
text-align: center;
984+
font-size: 14pt;
985+
font-weight: bold;
986+
padding: 10pt 0;
987+
border-bottom: 1pt solid #000;
988+
}
989+
}
990+
846991
.hero h1 {
847992
color: white;
848993
font-size: 2.5rem;

0 commit comments

Comments
 (0)