_print.scss 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. /* -----------------------/*
  2. * Feuille de style Print "Bretzel" adaptée
  3. * Made par Alsacréations + tweaks EQL
  4. /* ---------------------- */
  5. /*
  6. * Ressources et documentations :
  7. * 1- https://www.docuseal.co/blog/css-print-page-style
  8. * 2- https://www.alsacreations.com/astuce/lire/1160-Une-feuille-de-styles-de-base-pour-le-media-print.html
  9. */
  10. @import "variables/_colors";
  11. @import "variables/_typography";
  12. // Mixin commun pour les styles d'impression
  13. @mixin print-base() {
  14. /* Reset général */
  15. * {
  16. all: unset;
  17. display: revert;
  18. box-sizing: border-box;
  19. }
  20. img {
  21. max-width: 100%;
  22. }
  23. input,
  24. textarea,
  25. select {
  26. all: revert;
  27. }
  28. /* Styles globaux (12pt = 16px) */
  29. body,
  30. p,
  31. span {
  32. width: auto;
  33. margin: 0;
  34. font-family: "Marianne", serif !important;
  35. font-size: 12pt;
  36. line-height: 1.5;
  37. color: #000000 !important;
  38. background-color: #ffffff !important;
  39. }
  40. .back-cover {
  41. break-before: page;
  42. display: flex;
  43. flex-direction: column;
  44. justify-content: center;
  45. .region {
  46. h2 {
  47. margin-top: 0;
  48. color: $blue-dark;
  49. font-size: 1.2rem;
  50. }
  51. }
  52. .view-id-partenaires {
  53. .view-content {
  54. img {
  55. width: 5rem;
  56. height: auto;
  57. }
  58. a[href^="http"]:after {
  59. display: none;
  60. }
  61. }
  62. .views-row-wrapper {
  63. display: flex;
  64. flex-direction: row;
  65. flex-wrap: wrap;
  66. }
  67. }
  68. }
  69. /* Espacements typographiques (15pt = 20px) */
  70. p,
  71. blockquote,
  72. label,
  73. ul,
  74. ol {
  75. margin-block: 0 15pt;
  76. }
  77. p:last-child {
  78. margin-bottom: 0;
  79. }
  80. /* Titrages */
  81. h1 {
  82. margin-block: 0 24pt;
  83. font-weight: 700;
  84. font-size: 18pt;
  85. line-height: 1.1;
  86. }
  87. h2 {
  88. margin-block: 0 18pt;
  89. font-weight: 700;
  90. font-size: 16pt;
  91. line-height: 1.1;
  92. }
  93. h3 {
  94. margin-block: 0 15pt;
  95. font-weight: 700;
  96. font-size: 14pt;
  97. }
  98. h4 {
  99. margin-block: 0 12pt;
  100. font-weight: 700;
  101. font-size: 12pt;
  102. }
  103. /* Classes dédiées print / no-print */
  104. .print {
  105. display: revert;
  106. }
  107. .no-print {
  108. display: none;
  109. }
  110. /* Veuves / orphelines */
  111. p,
  112. blockquote {
  113. orphans: 3;
  114. widows: 3;
  115. }
  116. /* Pas de saut de page au sein de ces éléments */
  117. blockquote,
  118. ul,
  119. ol,
  120. figure,
  121. table,
  122. .paragraph,
  123. footer,
  124. .top_top,
  125. .top_bottom {
  126. page-break-inside: avoid;
  127. }
  128. /* Pas de saut de page après ces éléments */
  129. h1,
  130. h2,
  131. h3,
  132. h4,
  133. caption,
  134. .field--name-field-titre {
  135. page-break-after: avoid;
  136. }
  137. /* Styles des liens */
  138. a,
  139. a:link,
  140. a:visited {
  141. background: transparent !important;
  142. color: unset;
  143. font-weight: 700;
  144. text-decoration: underline !important;
  145. }
  146. /* Afficher l'URL des liens externes */
  147. a[href^="http"]:after,
  148. a[href^="https"]:after {
  149. content: " (" attr(href) ")";
  150. }
  151. /* Masquer vidéos, header, nav… */
  152. video,
  153. object,
  154. iframe,
  155. nav {
  156. display: none !important;
  157. width: 0 !important;
  158. height: 0 !important;
  159. overflow: hidden !important;
  160. }
  161. /* Style page projet */
  162. .page-node-type-projet {
  163. .layout__region--top {
  164. width: 100% !important;
  165. padding-top: 0rem !important;
  166. .top_top {
  167. flex-direction: column !important;
  168. .block-entity-fieldnodefield-photo {
  169. width: 100% !important;
  170. }
  171. .slick-dots,
  172. .slick-arrow {
  173. display: none;
  174. }
  175. .top_right {
  176. width: 100% !important;
  177. }
  178. }
  179. .top_bottom {
  180. width: 100% !important;
  181. }
  182. }
  183. .layout__region--first {
  184. display: none;
  185. }
  186. .layout__region--second {
  187. flex: 0 1 100% !important;
  188. }
  189. }
  190. }
  191. /* 1) VRAIE feuille d'impression */
  192. @media print {
  193. /* Dimension et marges de page */
  194. @page {
  195. size: A4 portrait;
  196. margin: 1.5cm 1.5cm;
  197. @bottom-center {
  198. content: "Page " counter(page) " / " counter(pages);
  199. }
  200. }
  201. @include print-base();
  202. /* --- Couverture : header-top en page 1 --- */
  203. .layout-container header {
  204. position: static !important; // ne plus être fixed en print
  205. width: 100% !important;
  206. box-shadow: none !important;
  207. }
  208. #header-top {
  209. display: flex !important;
  210. flex-direction: column;
  211. justify-content: center;
  212. align-items: center;
  213. height: 100vh; // occupe la hauteur de la "page"
  214. padding: 2cm 1.5cm; // marges internes
  215. text-align: center;
  216. page-break-after: always; // 👉 le contenu commence sur la page suivante
  217. background: #ffffff !important;
  218. color: #000000 !important;
  219. }
  220. /* On cache le menu du bas du header (la barre de navigation horizontale) */
  221. .region-header-bottom {
  222. display: none !important;
  223. }
  224. /* Si tu as un logo + titre dans #header-top, tu peux les grossir un peu : */
  225. #header-top .region-header-top-left img {
  226. max-height: 3cm;
  227. height: auto;
  228. width: auto;
  229. }
  230. #header-top .region-header-top-rigth #block-eql-identitedusite {
  231. font-size: 1.4rem;
  232. text-transform: uppercase;
  233. }
  234. }
  235. /* 2) MODE DEBUG : voir la version print en écran via body.debug-print */
  236. @media screen {
  237. body.debug-print {
  238. @include print-base();
  239. }
  240. }