css/print.css
/* =======
	PRINT
   =======
	This stylesheet describes the styles for the print version of a document.
	Only the HTML conversion view is printed. */
@media print {
	/* Pagination enabled (wouldn't work with fixed height and hidden overflow) */
	html,
	body,
	#document,
	#workspace,
	#conversion-container,
	#html-conversion {
		/* Box-model */
		height: auto;
	}

	body { padding: 1cm; }

	/* Delete inner margins and paddings */
	#conversion-container,
	#html-conversion {
		/* Box-model */
		padding: 0;
	}

	/* Delete useless UI elements */
	#mado-header,
	#switch-cursor,
	.sidebar,
	#markdown-container,
	#center-line-container,
	#mado-footer {
		/* Box-model */
		display: none;
	}

	#document {
		/* Visual */
		background: transparent; /* Save ink: no background color */
		border: none !important; /* Delete borders on Windows */
	}

	#conversion-container {
		/* Box-model */
		width: 100%; /* Even if the user is in "Both" view, the HTML view takes all the page's width */

		/* Typography */
		color: #000; /* Cleaner than dark grey for print */
	}

	/* Links are made obvious (for example if the user prints in black & white) */
	a { text-decoration: underline; }

	/* Links' URLs are displayed between parenthesis after the hypertext */
	a:after { content: " (" attr(href) ")"; }

	/* Horizontal rules: these styles enable the horizontal rules to be printed (wouldn't work with background-color) */
	hr {
		/* Visual */
		background-color: transparent !important;
		border-top: 1px solid #000 !important;
	}

	p,
	blockquote {
		/* Typography */
		orphans: 3; /* No single line at the bottom of a page */
		widows: 3; /* No single line at the top of a page */
	}

	blockquote,
	ul,
	ol {
		/* Typography */
		page-break-inside: avoid; /* No break inside these elements */
	}

	h1,
	h2,
	h3,
	h4,
	h5,
	h6,
	caption {
		/* Typography */
		page-break-after: avoid; /* No break after these elements */
	}

	td,
	th {
		/* Visual */
		border: 1px solid #000 !important;
	}

	/* Zebra stripes canceled */
	tbody tr:nth-child(2n+1) { background: transparent !important; }
}