You are here

default_pdf.css in Views Data Export PDF 7

Same filename and directory in other branches
  1. 7.2 css/default_pdf.css

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.css
View source
  1. /**
  2. * @file
  3. * Default stylesheet used for PDFs unless "Custom stylesheet path" is set.
  4. *
  5. * This is based on portions of the Seven theme in Drupal Core.
  6. */
  7. @import url('https://fonts.googleapis.com/css?family=EB+Garamond|Libre+Caslon+Text&display=swap');
  8. body {
  9. color: #000;
  10. /* We default to using a serif font for print, since they tend to be more
  11. readable in print.
  12. See:
  13. https://www.awai.com/2011/10/the-best-fonts-to-use-in-print-online-and-email/
  14. https://www.fonts.com/content/learning/fontology/level-1/type-anatomy/serif-vs-sans-for-text-in-print
  15. Portions of this list courtesy of:
  16. https://learning.linkedin.com/blog/design-tips/what-s-the-most-readable-typeface-for-print-
  17. */
  18. font-family: 'Libre Caslon Text', 'EB Garamond', Garamond, 'ITC Stone Serif',
  19. Georgia, 'DejaVu Serif', 'PT Serif', 'Times New Roman',
  20. Times, serif;
  21. font-size: 81.3%;
  22. line-height: 1.538em;
  23. background: #fff;
  24. }
  25. body.pdf-page-header,
  26. body.pdf-page-footer {
  27. /**
  28. * The margin on headers and footers is 0 to avoid header and footer overlap
  29. * of content in the PDF, per: https://stackoverflow.com/a/11517290/4342230
  30. */
  31. margin: 0;
  32. padding: 1em 0.5em;
  33. }
  34. h1,
  35. h2,
  36. h3,
  37. h4,
  38. h5,
  39. h6 {
  40. font-weight: bold;
  41. margin: 0 0 1em 0;
  42. }
  43. h1 {
  44. font-size: 1.538em;
  45. }
  46. h2 {
  47. font-size: 1.385em;
  48. }
  49. h3 {
  50. font-size: 1.231em;
  51. }
  52. h4 {
  53. font-size: 1.154em;
  54. }
  55. h5,
  56. h6 {
  57. font-size: 1.077em;
  58. }
  59. table {
  60. width: 100%;
  61. margin: 0 0 10px;
  62. border: 1px solid #bebfb9;
  63. font-size: 0.923em;
  64. }
  65. tr, td, th {
  66. page-break-inside: avoid !important;
  67. }
  68. table td,
  69. table th {
  70. border: 1px solid #ccc;
  71. padding: 0.5em;
  72. vertical-align: top;
  73. color: #000;
  74. }
  75. tr.even,
  76. tr.odd {
  77. border-width: 0 1px 0 1px;
  78. border-style: solid;
  79. border-color: #bebfb9;
  80. background: #f3f4ee;
  81. }
  82. tr.odd {
  83. background: #fff;
  84. }
  85. table th {
  86. border-width: 1px;
  87. border-style: solid;
  88. border-color: #bebfb9;
  89. text-transform: uppercase;
  90. font-weight: bold;
  91. background: #e1e2dc;
  92. }
  93. table th.active {
  94. background: #bdbeb9;
  95. }
  96. table th a {
  97. display: block;
  98. position: relative;
  99. }
  100. table th.active a {
  101. padding: 0 25px 0 0; /* LTR */
  102. }
  103. table th.active img {
  104. position: absolute;
  105. top: 3px;
  106. right: 3px; /* LTR */
  107. }
  108. table td.active {
  109. background: #e9e9dd;
  110. }
  111. table tr.odd td.active {
  112. background: #f3f4ee;
  113. }
  114. table tr.selected td.active,
  115. table tr.selected td {
  116. border-color: #eeb;
  117. background: #ffc;
  118. }
  119. ul,
  120. .item-list ul {
  121. list-style-type: disc;
  122. list-style-image: none;
  123. margin: 0 0 0 2em; /* LTR */
  124. padding: 0;
  125. }
  126. .item-list ul li {
  127. list-style-type: disc;
  128. list-style-image: none;
  129. }
  130. ol {
  131. list-style-type: decimal;
  132. margin: 0 0 0 2em; /* LTR */
  133. padding: 0;
  134. }
  135. /* wkhtmltopdf-specific Overrides */
  136. .pdf-page-header-content--wkhtmltopdf::after {
  137. /* This ensures we don't cover-up the page body content. */
  138. /* Approach from: https://www.w3schools.com/howto/howto_css_clearfix.asp */
  139. display: table;
  140. content: "";
  141. clear: both;
  142. }
  143. .pdf-page-header-content--wkhtmltopdf .header-left,
  144. .pdf-page-header-content--wkhtmltopdf .header-right,
  145. .pdf-page-footer-content--wkhtmltopdf .footer-left,
  146. .pdf-page-footer-content--wkhtmltopdf .footer-right {
  147. display: inline-block;
  148. }
  149. .pdf-page-header-content--wkhtmltopdf .header-right,
  150. .pdf-page-footer-content--wkhtmltopdf .footer-right {
  151. float: right;
  152. }
  153. /* mPDF-specific Overrides */
  154. .pdf-page-header-content--mpdf .header-left,
  155. .pdf-page-footer-content--mpdf .footer-left {
  156. float: left;
  157. width: 50%;
  158. }
  159. .pdf-page-header-content--mpdf .header-right,
  160. .pdf-page-footer-content--mpdf .footer-right {
  161. float: right;
  162. width: 50%;
  163. text-align: right;
  164. }