balmet.com

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

print.scss (3080B)


      1 /*
      2 Adding print support. The print styles are based on the the great work of
      3 Andreas Hecht in https://www.jotform.com/blog/css-perfect-print-stylesheet-98272/.
      4 */
      5 
      6 /*--------------------------------------------------------------
      7 >>> TABLE OF CONTENTS:
      8 ----------------------------------------------------------------
      9 # Margins & paddings
     10 # Typography
     11 # Page breaks
     12 # Links
     13 # Visibility
     14 --------------------------------------------------------------*/
     15 
     16 @media print {
     17 
     18 	/* Margins & paddings */
     19 
     20 	@page {
     21 		margin: 2cm;
     22 	}
     23 
     24 	.entry .entry-header,
     25 	.entry,
     26 	.single .site-main > article > .entry-footer {
     27 		margin-top: 0;
     28 		margin-bottom: 0;
     29 	}
     30 
     31 	.site-footer .site-info {
     32 		margin: 0;
     33 	}
     34 
     35 	.site-header {
     36 		padding: 0;
     37 	}
     38 
     39 	/* Fonts */
     40 
     41 	body {
     42 		font: 13pt Georgia, "Times New Roman", Times, serif; // Fallback for browsers without CSS variables support.
     43 		font: 13pt var(--global--font-secondary, Georgia, "Times New Roman", Times, serif);
     44 		line-height: 1.3;
     45 		background: #fff !important;
     46 		color: #000;
     47 	}
     48 
     49 	// Override color settings that changes the text to white.
     50 	.has-background-dark * {
     51 		color: #000 !important;
     52 	}
     53 
     54 	h1,
     55 	.entry-title,
     56 	.singular .entry-title,
     57 	.page-title {
     58 		font-size: 22pt;
     59 		font-weight: bold;
     60 	}
     61 
     62 	h2,
     63 	h3,
     64 	h4,
     65 	.has-regular-font-size,
     66 	.has-large-font-size,
     67 	h2.author-title,
     68 	p.author-bio,
     69 	.comments-title,
     70 	.archive-description {
     71 		font-size: 14pt;
     72 		margin-top: 25px;
     73 	}
     74 
     75 	.comment-meta,
     76 	.comment-meta .comment-author .fn {
     77 		font-size: 13pt;
     78 	}
     79 
     80 	/* Page breaks */
     81 
     82 	a {
     83 		page-break-inside: avoid;
     84 	}
     85 
     86 	blockquote {
     87 		page-break-inside: avoid;
     88 	}
     89 
     90 	h1,
     91 	h2,
     92 	h3,
     93 	h4,
     94 	h5,
     95 	h6 {
     96 		page-break-after: avoid;
     97 		page-break-inside: avoid;
     98 	}
     99 
    100 	img {
    101 		page-break-inside: avoid;
    102 		page-break-after: avoid;
    103 	}
    104 
    105 	table,
    106 	pre,
    107 	figure {
    108 		page-break-inside: avoid;
    109 	}
    110 
    111 	ul,
    112 	ol,
    113 	dl {
    114 		page-break-before: avoid;
    115 	}
    116 
    117 	/* Links */
    118 
    119 	a:link,
    120 	a:visited,
    121 	a {
    122 		background: transparent;
    123 		font-weight: bold;
    124 		text-decoration: underline;
    125 		text-align: left;
    126 	}
    127 
    128 	a[href^="http"]:after {
    129 		content: " < " attr(href) "> ";
    130 	}
    131 
    132 	a:after > img {
    133 		content: "";
    134 	}
    135 
    136 	article a[href^="#"]:after {
    137 		content: "";
    138 	}
    139 
    140 	a:not(:local-link):after { // stylelint-disable-line selector-pseudo-class-no-unknown
    141 		content: " < " attr(href) "> ";
    142 	}
    143 
    144 	.entry-title a:after {
    145 		content: "\a < " attr(href) "> ";
    146 		white-space: pre;
    147 		font-size: 14pt;
    148 	}
    149 
    150 	.cat-links a:after,
    151 	.tags-links a:after,
    152 	.byline a:after,
    153 	.comment-metadata a:after,
    154 	.wp-block-calendar a:after,
    155 	.wp-block-tag-cloud a:after,
    156 	.page-links a:after {
    157 		content: "";
    158 	}
    159 
    160 	/* Visibility */
    161 	.primary-navigation,
    162 	.site-title + .primary-navigation,
    163 	.footer-navigation,
    164 	.entry-footer,
    165 	.post-navigation,
    166 	.navigation.pagination,
    167 	.widget-area,
    168 	.edit-link,
    169 	.more-link,
    170 	.comment-reply,
    171 	.reply,
    172 	.comment .comment-metadata .edit-link,
    173 	.comment-respond,
    174 	#dark-mode-toggler {
    175 		display: none !important;
    176 	}
    177 
    178 	.entry .entry-content .wp-block-button .wp-block-button__link,
    179 	.entry .entry-content .button,
    180 	.entry .entry-content .wp-block-file__button {
    181 		color: #000;
    182 		background: none;
    183 	}
    184 }