Skip to content

Commit edd7089

Browse files
authored
Update print.html
1 parent 835f35e commit edd7089

1 file changed

Lines changed: 29 additions & 33 deletions

File tree

‎overrides/print.html‎

Lines changed: 29 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,20 @@
1919
padding: 0 !important;
2020
}
2121

22-
/* Fond de "bureau" neutre autour des feuilles (écran) */
23-
body { background: #e9e9ec !important; }
24-
.pagedjs_pages { display: flex; flex-direction: column; gap: 10px; align-items: center; }
25-
.pagedjs_page { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
22+
/* Fond de "bureau" neutre autour des feuilles (écran uniquement) */
23+
@media screen {
24+
body { background: #e9e9ec !important; }
25+
.pagedjs_pages {
26+
display: flex;
27+
flex-direction: column;
28+
gap: 10px;
29+
align-items: center;
30+
}
31+
.pagedjs_page {
32+
background: #fff;
33+
box-shadow: 0 2px 8px rgba(0,0,0,.25);
34+
}
35+
}
2636

2737
/* ================= TYPOGRAPHIE ================= */
2838
.md-typeset {
@@ -43,7 +53,7 @@
4353
}
4454
.md-typeset li { margin-bottom: 0.25em; }
4555

46-
/* ---- Titres : hiérarchie claire, encadrés de chapitre ---- */
56+
/* ---- Titres ---- */
4757
.md-typeset h1 {
4858
font-size: 1.7rem;
4959
line-height: 1.25;
@@ -75,6 +85,8 @@
7585
border-left: 3px solid #4051b5;
7686
border-radius: 2px;
7787
padding: 0.7em 0.9em !important;
88+
white-space: pre-wrap !important;
89+
word-break: break-word;
7890
}
7991
.md-typeset :not(pre) > code {
8092
background: #f0f0ec;
@@ -83,7 +95,7 @@
8395
border-radius: 2px;
8496
}
8597

86-
/* ---- Admonitions : encadrés sobres pour le papier ---- */
98+
/* ---- Admonitions ---- */
8799
.md-typeset .admonition {
88100
border-radius: 3px;
89101
border: 1px solid #ccc;
@@ -94,7 +106,7 @@
94106
}
95107
.md-typeset .admonition-title { font-weight: bold; }
96108

97-
/* ---- Tableaux : lignes nettes, en-tête grisé ---- */
109+
/* ---- Tableaux ---- */
98110
.md-typeset table {
99111
width: 100% !important;
100112
font-size: 9.5pt;
@@ -112,17 +124,9 @@
112124
padding: 0.35em 0.6em;
113125
}
114126

115-
/* ---- Images ---- */
127+
/* ---- Images, figures, boutons, liens ---- */
116128
.md-typeset img { max-width: 100% !important; break-inside: avoid; }
117129
.md-typeset figure { break-inside: avoid; margin: 0.8em 0; }
118-
119-
/* ---- Blocs code : pas de débordement ---- */
120-
.md-typeset pre, .md-typeset code {
121-
white-space: pre-wrap !important;
122-
word-break: break-word;
123-
}
124-
125-
/* ---- Boutons authoring : style sobre à l'impression ---- */
126130
.md-typeset .md-button {
127131
border: 1.5px solid #4051b5 !important;
128132
color: #4051b5 !important;
@@ -133,9 +137,8 @@
133137
background: #4051b5 !important;
134138
color: #fff !important;
135139
}
136-
137-
/* ---- Liens : sobre, URL visible en print ---- */
138140
.md-typeset a { color: #1a5fb4 !important; text-decoration: none; }
141+
.tabbed-set .tabbed-content { display: block !important; }
139142

140143
/* ================= PAGE DE GARDE ================= */
141144
.print-cover {
@@ -171,7 +174,6 @@
171174
.print-toc li { margin: 0; padding: 0; }
172175
.print-toc > ul { counter-reset: tocchap; }
173176

174-
/* niveau 1 : chapitres */
175177
.print-toc > ul > li {
176178
font-weight: bold;
177179
margin-top: 0.75rem;
@@ -181,12 +183,10 @@
181183
content: counter(tocchap) ". ";
182184
color: #4051b5;
183185
}
184-
/* niveau 2 : sous-sections */
185186
.print-toc > ul > li > ul {
186187
padding-left: 1.7rem;
187188
font-weight: normal;
188189
}
189-
/* ligne titre ...... n° */
190190
.print-toc li a {
191191
display: flex;
192192
align-items: baseline;
@@ -198,7 +198,6 @@
198198
content: target-counter(attr(href url), page);
199199
margin-left: auto;
200200
font-weight: normal;
201-
font paragraph-height: 0;
202201
font-size: 0.9em;
203202
color: #444;
204203
}
@@ -215,17 +214,17 @@
215214
page-break-before: always;
216215
}
217216

218-
/* pas de titre orphelin en bas de page */
217+
/* pas de titre orphelin, pas de bloc coupé */
219218
h1, h2, h3 { break-after: avoid; page-break-after: avoid; }
220219
h1, h2, h3, h4, h5, h6,
221220
table, figure, blockquote, .admonition {
222221
break-inside: avoid; page-break-inside: avoid;
223222
}
224223

225-
/* ================= PAGINATION ================= */
224+
/* ================= PAGINATION (Paged.js) ================= */
226225
@page {
227226
size: A4;
228-
margin: 22mm 19mm 24mm 19mm; /* marge basse plus grande : footer */
227+
margin: 22mm 19mm 24mm 19mm;
229228
@bottom-center {
230229
content: counter(page) " / " counter(pages);
231230
font-family: "Palatino Linotype", Palatino, Georgia, serif;
@@ -240,24 +239,21 @@
240239
}
241240
}
242241
@page :first {
243-
margin-top: 0; /* couverture pleine hauteur */
244242
@bottom-center { content: none; }
245243
@bottom-right { content: none; }
246244
}
247245

248246
/* ================= IMPRESSION (Ctrl+P) ================= */
249247
@media print {
250-
/* Les feuilles Paged.js embarquent déjà les marges : le navigateur
251-
n'en rajoute pas. */
252-
@page { size: A4; margin: 0; }
253248
html, body { background: #fff !important; }
254249
.pagedjs_pages { gap: 0 !important; display: block !important; }
255250
.pagedjs_page {
256251
margin: 0 !important;
257252
box-shadow: none !important;
258-
break-after: page; /* une feuille HTML = une feuille papier */
253+
break-after: page; /* une feuille HTML = une feuille papier */
259254
}
260-
} </style>
255+
}
256+
</style>
261257
{% endblock %}
262258

263259
{% block scripts %}
@@ -284,8 +280,8 @@
284280
</script>
285281
<script src="https://unpkg.com/pagedjs/dist/paged.polyfill.js"></script>
286282
<script>
287-
// Si Paged.js n'a pas paginé (CDN bloqué, erreur), réinjecter des
288-
// marges de page pour que l'impression reste lisible.
283+
// Filet de sécurité : si Paged.js n'a pas pu paginer (CDN bloqué,
284+
// erreur), réinjecter des marges pour que l'impression reste lisible.
289285
window.addEventListener('beforeprint', () => {
290286
if (!document.querySelector('.pagedjs_page')) {
291287
const style = document.createElement('style');

0 commit comments

Comments
 (0)