Skip to content

Commit eb16a6a

Browse files
committed
Printable cover edits
Responding to feedback from PC. - Add ® - Add footer - Generate back cover - Capitalise "Page" Also - Remove unused class - Re-generate front cover from original brand refresh in 2003
1 parent 44d8f38 commit eb16a6a

File tree

6 files changed

+246
-122
lines changed

6 files changed

+246
-122
lines changed

css/print.css

Lines changed: 30 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -135,55 +135,40 @@
135135
}
136136
}
137137

138-
@page :first, :nth(2) {
139-
margin: 0;
140-
141-
@top-left {
142-
content: none;
143-
}
144-
145-
@top-right {
146-
content: none;
147-
}
148-
149-
@bottom-left {
150-
content: none;
151-
}
152-
153-
@bottom-right {
154-
content: none;
155-
}
156-
}
157-
158138
@page toc, copyright, intro {
159139
--page-number-style: lower-roman;
160140
}
161141

162-
@page :blank {
163-
@bottom-left {
164-
content: none;
165-
}
142+
@page front-cover {
143+
background-image: url('../img/print-front-cover.svg');
144+
margin: 0;
166145

167146
@bottom-right {
168147
content: none;
169148
}
170149
}
171150

172-
@page front-cover {
173-
background-image: url('../img/print-front-cover.svg');
174-
}
175-
176151
@page inside-cover {
177152
background-image: url('../img/print-inside-cover.svg');
178153
}
179154

180155
@page front-cover, inside-cover {
181156
background-color: transparent;
182-
background-position: center;
157+
background-position: top center;
183158
background-repeat: no-repeat;
184-
margin: 0;
185-
padding: 0;
186159
page-break-after: always;
160+
161+
@top-left {
162+
content: none;
163+
}
164+
165+
@top-right {
166+
content: none;
167+
}
168+
169+
@bottom-left {
170+
content: none;
171+
}
187172
}
188173

189174
html, body {
@@ -495,7 +480,7 @@ emu-figure img {
495480
}
496481

497482
#toc > h2::after {
498-
content: 'page';
483+
content: 'Page';
499484
float: right;
500485
font-size: 10pt;
501486
text-align: right;
@@ -559,11 +544,12 @@ a[data-print-href]::after {
559544
width: auto;
560545
}
561546

562-
emu-annex > h1 {
547+
#spec-container > emu-annex > h1 {
548+
font-size: 14pt;
563549
text-align: center;
564550
}
565551

566-
emu-annex > h1 span {
552+
#spec-container > emu-annex > h1 span {
567553
display: block;
568554
}
569555

@@ -588,7 +574,6 @@ emu-annex > h1 .secnum {
588574
page: front-cover;
589575
position: relative;
590576
width: 210mm;
591-
height: 297mm;
592577
}
593578

594579
#front-cover h1 {
@@ -642,6 +627,16 @@ h1.version {
642627
page: inside-cover;
643628
}
644629

630+
#back-cover {
631+
float: bottom;
632+
page: back-cover;
633+
}
634+
635+
#back-cover hr {
636+
border-width: 0.25pt;
637+
margin: 0.75pt auto;
638+
}
639+
645640
#toc {
646641
page: toc;
647642
counter-reset: page 1;

img/print-front-cover.svg

Lines changed: 121 additions & 4 deletions
Loading

img/print-inside-cover.svg

Lines changed: 52 additions & 44 deletions
Loading

src/Spec.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,6 @@ export default class Spec {
619619
// front cover
620620
const frontCover = document.createElement('div');
621621

622-
frontCover.classList.add('full-page-svg');
623622
frontCover.setAttribute('id', 'front-cover');
624623

625624
const versionNode = this.doc.querySelector('h1.version');
@@ -634,10 +633,20 @@ export default class Spec {
634633
// inside cover
635634
const insideCover = document.createElement('div');
636635

637-
insideCover.classList.add('full-page-svg');
638636
insideCover.setAttribute('id', 'inside-cover');
639637

640638
frontCover.after(insideCover);
639+
640+
// back cover
641+
const backCover = document.createElement('div');
642+
643+
backCover.setAttribute('id', 'back-cover');
644+
backCover.append(
645+
document.createElement('hr'),
646+
document.createElement('hr'),
647+
document.createElement('hr'),
648+
);
649+
wrapper.after(backCover);
641650
}
642651

643652
let commonEles: HTMLElement[] = [];

test/baselines/generated-reference/assets-inline.html

Lines changed: 30 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3387,55 +3387,40 @@
33873387
}
33883388
}
33893389
3390-
@page :first, :nth(2) {
3391-
margin: 0;
3392-
3393-
@top-left {
3394-
content: none;
3395-
}
3396-
3397-
@top-right {
3398-
content: none;
3399-
}
3400-
3401-
@bottom-left {
3402-
content: none;
3403-
}
3404-
3405-
@bottom-right {
3406-
content: none;
3407-
}
3408-
}
3409-
34103390
@page toc, copyright, intro {
34113391
--page-number-style: lower-roman;
34123392
}
34133393
3414-
@page :blank {
3415-
@bottom-left {
3416-
content: none;
3417-
}
3394+
@page front-cover {
3395+
background-image: url('../img/print-front-cover.svg');
3396+
margin: 0;
34183397
34193398
@bottom-right {
34203399
content: none;
34213400
}
34223401
}
34233402
3424-
@page front-cover {
3425-
background-image: url('../img/print-front-cover.svg');
3426-
}
3427-
34283403
@page inside-cover {
34293404
background-image: url('../img/print-inside-cover.svg');
34303405
}
34313406
34323407
@page front-cover, inside-cover {
34333408
background-color: transparent;
3434-
background-position: center;
3409+
background-position: top center;
34353410
background-repeat: no-repeat;
3436-
margin: 0;
3437-
padding: 0;
34383411
page-break-after: always;
3412+
3413+
@top-left {
3414+
content: none;
3415+
}
3416+
3417+
@top-right {
3418+
content: none;
3419+
}
3420+
3421+
@bottom-left {
3422+
content: none;
3423+
}
34393424
}
34403425
34413426
html, body {
@@ -3747,7 +3732,7 @@
37473732
}
37483733
37493734
#toc > h2::after {
3750-
content: 'page';
3735+
content: 'Page';
37513736
float: right;
37523737
font-size: 10pt;
37533738
text-align: right;
@@ -3811,11 +3796,12 @@
38113796
width: auto;
38123797
}
38133798
3814-
emu-annex > h1 {
3799+
#spec-container > emu-annex > h1 {
3800+
font-size: 14pt;
38153801
text-align: center;
38163802
}
38173803
3818-
emu-annex > h1 span {
3804+
#spec-container > emu-annex > h1 span {
38193805
display: block;
38203806
}
38213807
@@ -3840,7 +3826,6 @@
38403826
page: front-cover;
38413827
position: relative;
38423828
width: 210mm;
3843-
height: 297mm;
38443829
}
38453830
38463831
#front-cover h1 {
@@ -3894,6 +3879,16 @@
38943879
page: inside-cover;
38953880
}
38963881
3882+
#back-cover {
3883+
float: bottom;
3884+
page: back-cover;
3885+
}
3886+
3887+
#back-cover hr {
3888+
border-width: 0.25pt;
3889+
margin: 0.75pt auto;
3890+
}
3891+
38973892
#toc {
38983893
page: toc;
38993894
counter-reset: page 1;

test/baselines/generated-reference/clauses.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!doctype html>
2-
<head><meta name="viewport" content="width=device-width, initial-scale=1"><meta charset="utf-8"><title>Test Doc</title></head><body class=" oldtoc"><div class="full-page-svg" id="front-cover"><h1 class="title">Test Doc</h1></div><div class="full-page-svg" id="inside-cover"></div><div id="spec-container">
2+
<head><meta name="viewport" content="width=device-width, initial-scale=1"><meta charset="utf-8"><title>Test Doc</title></head><body class=" oldtoc"><div id="front-cover"><h1 class="title">Test Doc</h1></div><div id="inside-cover"></div><div id="spec-container">
33
<div id="toc"><h2>Contents</h2><ol class="toc"><li><a href="#sec-intro" title="Intro">Intro</a><ol class="toc"><li><a href="#sec-intro2" title="Sub Intro">Sub Intro</a></li></ol></li><li><a href="#sec-clause" title="Clause Foo(a, b)"><span class="secnum">1</span> Clause Foo(<var>a</var>, <var>b</var>)</a><ol class="toc"><li><a href="#Foo" title="Sub Clause"><span class="secnum">1.1</span> Sub Clause</a></li></ol></li><li><a href="#sec-number" title="Explicit number"><span class="secnum">7</span> Explicit number</a><ol class="toc"><li><a href="#sec-number1" title="Automatic number inside explicit number"><span class="secnum">7.1</span> Automatic number inside explicit number</a></li><li><a href="#sec-number2" title="Nested explicit number"><span class="secnum">7.4</span> Nested explicit number</a></li><li><a href="#sec-number3" title="Automatic number after explicit number"><span class="secnum">7.5</span> Automatic number after explicit number</a></li><li><a href="#sec-number-nested" title="Multi-step explicit numbers"><span class="secnum">7.6</span> Multi-step explicit numbers</a><ol class="toc"><li><a href="#sec-number-multi-step" title="Multi-step explicit numbers"><span class="secnum">7.6.1.1</span> Multi-step explicit numbers</a></li><li><a href="#sec-number-multi-step-1" title="Automatic number after explicit number"><span class="secnum">7.6.1.2</span> Automatic number after explicit number</a></li><li><a href="#sec-number-multi-step-2" title="Increasing multi-step explicit numbers"><span class="secnum">7.6.2.1</span> Increasing multi-step explicit numbers</a></li></ol></li></ol></li><li><a href="#sec-annex" title="Annex"><span class="secnum">Annex A <span class="annex-kind">(informative)</span></span> Annex</a><ol class="toc"><li><a href="#sec-annex2" title="Sub-annex"><span class="secnum">A.1</span> Sub-annex</a></li></ol></li></ol></div><emu-intro id="sec-intro">
44
<h1>Intro</h1>
55
<emu-intro id="sec-intro2">
@@ -59,4 +59,4 @@ <h1><span class="secnum">A.1</span> Sub-annex</h1>
5959

6060
</emu-annex>
6161
</emu-annex>
62-
</div></body>
62+
</div><div id="back-cover"><hr><hr><hr></div></body>

0 commit comments

Comments
 (0)