default_pdf.css in Views Data Export PDF 7
Same filename and directory in other branches
Default stylesheet used for PDFs unless "Custom stylesheet path" is set.
This is based on portions of the Seven theme in Drupal Core.
File
css/default_pdf.cssView source
- /**
- * @file
- * Default stylesheet used for PDFs unless "Custom stylesheet path" is set.
- *
- * This is based on portions of the Seven theme in Drupal Core.
- */
- @import url('https://fonts.googleapis.com/css?family=EB+Garamond|Libre+Caslon+Text&display=swap');
-
- body {
- color: #000;
-
- /* We default to using a serif font for print, since they tend to be more
- readable in print.
-
- See:
- https://www.awai.com/2011/10/the-best-fonts-to-use-in-print-online-and-email/
- https://www.fonts.com/content/learning/fontology/level-1/type-anatomy/serif-vs-sans-for-text-in-print
-
- Portions of this list courtesy of:
- https://learning.linkedin.com/blog/design-tips/what-s-the-most-readable-typeface-for-print-
- */
- font-family: 'Libre Caslon Text', 'EB Garamond', Garamond, 'ITC Stone Serif',
- Georgia, 'DejaVu Serif', 'PT Serif', 'Times New Roman',
- Times, serif;
- font-size: 81.3%;
- line-height: 1.538em;
-
- background: #fff;
- }
-
- body.pdf-page-header,
- body.pdf-page-footer {
- /**
- * The margin on headers and footers is 0 to avoid header and footer overlap
- * of content in the PDF, per: https://stackoverflow.com/a/11517290/4342230
- */
- margin: 0;
- padding: 1em 0.5em;
- }
-
- h1,
- h2,
- h3,
- h4,
- h5,
- h6 {
- font-weight: bold;
- margin: 0 0 1em 0;
- }
-
- h1 {
- font-size: 1.538em;
- }
-
- h2 {
- font-size: 1.385em;
- }
-
- h3 {
- font-size: 1.231em;
- }
-
- h4 {
- font-size: 1.154em;
- }
-
- h5,
- h6 {
- font-size: 1.077em;
- }
-
- table {
- width: 100%;
-
- margin: 0 0 10px;
- border: 1px solid #bebfb9;
-
- font-size: 0.923em;
- }
-
- tr, td, th {
- page-break-inside: avoid !important;
- }
-
- table td,
- table th {
- border: 1px solid #ccc;
- padding: 0.5em;
-
- vertical-align: top;
- color: #000;
- }
-
- tr.even,
- tr.odd {
- border-width: 0 1px 0 1px;
- border-style: solid;
- border-color: #bebfb9;
- background: #f3f4ee;
- }
-
- tr.odd {
- background: #fff;
- }
-
- table th {
- border-width: 1px;
- border-style: solid;
- border-color: #bebfb9;
-
- text-transform: uppercase;
- font-weight: bold;
-
- background: #e1e2dc;
- }
-
- table th.active {
- background: #bdbeb9;
- }
-
- table th a {
- display: block;
-
- position: relative;
- }
-
- table th.active a {
- padding: 0 25px 0 0; /* LTR */
- }
-
- table th.active img {
- position: absolute;
- top: 3px;
- right: 3px; /* LTR */
- }
-
- table td.active {
- background: #e9e9dd;
- }
-
- table tr.odd td.active {
- background: #f3f4ee;
- }
-
- table tr.selected td.active,
- table tr.selected td {
- border-color: #eeb;
-
- background: #ffc;
- }
-
- ul,
- .item-list ul {
- list-style-type: disc;
- list-style-image: none;
-
- margin: 0 0 0 2em; /* LTR */
- padding: 0;
- }
-
- .item-list ul li {
- list-style-type: disc;
- list-style-image: none;
- }
-
- ol {
- list-style-type: decimal;
-
- margin: 0 0 0 2em; /* LTR */
- padding: 0;
- }
-
- /* wkhtmltopdf-specific Overrides */
- .pdf-page-header-content--wkhtmltopdf::after {
- /* This ensures we don't cover-up the page body content. */
- /* Approach from: https://www.w3schools.com/howto/howto_css_clearfix.asp */
- display: table;
- content: "";
-
- clear: both;
- }
-
- .pdf-page-header-content--wkhtmltopdf .header-left,
- .pdf-page-header-content--wkhtmltopdf .header-right,
- .pdf-page-footer-content--wkhtmltopdf .footer-left,
- .pdf-page-footer-content--wkhtmltopdf .footer-right {
- display: inline-block;
- }
-
- .pdf-page-header-content--wkhtmltopdf .header-right,
- .pdf-page-footer-content--wkhtmltopdf .footer-right {
- float: right;
- }
-
- /* mPDF-specific Overrides */
- .pdf-page-header-content--mpdf .header-left,
- .pdf-page-footer-content--mpdf .footer-left {
- float: left;
-
- width: 50%;
- }
-
- .pdf-page-header-content--mpdf .header-right,
- .pdf-page-footer-content--mpdf .footer-right {
- float: right;
-
- width: 50%;
-
- text-align: right;
- }