electric-book-classic-theme 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +4 -0
  3. data/Gemfile +2 -0
  4. data/LICENSE.txt +21 -0
  5. data/README.md +66 -0
  6. data/_includes/close-body.html +3 -0
  7. data/_includes/close-wrapper.html +2 -0
  8. data/_includes/footer.html +10 -0
  9. data/_includes/head.html +109 -0
  10. data/_includes/nav.html +27 -0
  11. data/_includes/start-wrapper.html +1 -0
  12. data/_layouts/default.html +26 -0
  13. data/_layouts/min.html +7 -0
  14. data/_sass/epub.scss +76 -0
  15. data/_sass/js/index.js +8 -0
  16. data/_sass/mods/print-no-bleed.css +7 -0
  17. data/_sass/mods/print-no-crop-marks.css +6 -0
  18. data/_sass/mods/print-page-setup-lightning-source-colour.css +31 -0
  19. data/_sass/partials/_epub-base-typography.scss +118 -0
  20. data/_sass/partials/_epub-bibliographies.scss +20 -0
  21. data/_sass/partials/_epub-boxes.scss +24 -0
  22. data/_sass/partials/_epub-buttons.scss +21 -0
  23. data/_sass/partials/_epub-copyright-page.scss +14 -0
  24. data/_sass/partials/_epub-cover.scss +24 -0
  25. data/_sass/partials/_epub-dedications.scss +17 -0
  26. data/_sass/partials/_epub-epigraphs.scss +30 -0
  27. data/_sass/partials/_epub-figures.scss +40 -0
  28. data/_sass/partials/_epub-fitting.scss +16 -0
  29. data/_sass/partials/_epub-glossary.scss +15 -0
  30. data/_sass/partials/_epub-index.scss +21 -0
  31. data/_sass/partials/_epub-maths.scss +9 -0
  32. data/_sass/partials/_epub-notes.scss +33 -0
  33. data/_sass/partials/_epub-openers.scss +8 -0
  34. data/_sass/partials/_epub-pullquotes.scss +16 -0
  35. data/_sass/partials/_epub-quotations.scss +5 -0
  36. data/_sass/partials/_epub-reset-sequences.scss +31 -0
  37. data/_sass/partials/_epub-smallcaps.scss +21 -0
  38. data/_sass/partials/_epub-tables.scss +45 -0
  39. data/_sass/partials/_epub-title-page.scss +34 -0
  40. data/_sass/partials/_epub-toc.scss +41 -0
  41. data/_sass/partials/_epub-valedictions.scss +8 -0
  42. data/_sass/partials/_epub-verse.scss +138 -0
  43. data/_sass/partials/_epub-wrappers.scss +12 -0
  44. data/_sass/partials/_hide-footer.scss +7 -0
  45. data/_sass/partials/_hide-nav-bar.scss +7 -0
  46. data/_sass/partials/_print-base-typography.scss +153 -0
  47. data/_sass/partials/_print-bibliographies.scss +20 -0
  48. data/_sass/partials/_print-boxes.scss +39 -0
  49. data/_sass/partials/_print-code.scss +19 -0
  50. data/_sass/partials/_print-copyright-page.scss +23 -0
  51. data/_sass/partials/_print-dedications.scss +11 -0
  52. data/_sass/partials/_print-definition-lists.scss +13 -0
  53. data/_sass/partials/_print-epigraphs.scss +24 -0
  54. data/_sass/partials/_print-figures.scss +97 -0
  55. data/_sass/partials/_print-fitting.scss +38 -0
  56. data/_sass/partials/_print-front-cover.scss +26 -0
  57. data/_sass/partials/_print-hide-non-printing.scss +8 -0
  58. data/_sass/partials/_print-hide-video.scss +7 -0
  59. data/_sass/partials/_print-hyphenation.scss +18 -0
  60. data/_sass/partials/_print-index.scss +30 -0
  61. data/_sass/partials/_print-maths.scss +5 -0
  62. data/_sass/partials/_print-notes.scss +40 -0
  63. data/_sass/partials/_print-openers.scss +14 -0
  64. data/_sass/partials/_print-page-break-tools.scss +46 -0
  65. data/_sass/partials/_print-page-headers-footers-content.scss +236 -0
  66. data/_sass/partials/_print-page-headers-footers-style.scss +150 -0
  67. data/_sass/partials/_print-page-setup.scss +43 -0
  68. data/_sass/partials/_print-page-start-depth.scss +4 -0
  69. data/_sass/partials/_print-pdf-view.scss +42 -0
  70. data/_sass/partials/_print-pullquotes.scss +13 -0
  71. data/_sass/partials/_print-quotations.scss +6 -0
  72. data/_sass/partials/_print-reset-sequences.scss +27 -0
  73. data/_sass/partials/_print-smallcaps.scss +29 -0
  74. data/_sass/partials/_print-start-on-recto-or-verso.scss +28 -0
  75. data/_sass/partials/_print-tables.scss +48 -0
  76. data/_sass/partials/_print-title-pages.scss +59 -0
  77. data/_sass/partials/_print-toc.scss +57 -0
  78. data/_sass/partials/_print-valedictions.scss +9 -0
  79. data/_sass/partials/_print-verse.scss +141 -0
  80. data/_sass/partials/_web-base-typography.scss +106 -0
  81. data/_sass/partials/_web-bibliographies.scss +20 -0
  82. data/_sass/partials/_web-boxes.scss +30 -0
  83. data/_sass/partials/_web-buttons.scss +21 -0
  84. data/_sass/partials/_web-code.scss +19 -0
  85. data/_sass/partials/_web-copyright-page.scss +14 -0
  86. data/_sass/partials/_web-cover.scss +33 -0
  87. data/_sass/partials/_web-dedications.scss +17 -0
  88. data/_sass/partials/_web-definition-lists.scss +12 -0
  89. data/_sass/partials/_web-epigraphs.scss +31 -0
  90. data/_sass/partials/_web-figures.scss +55 -0
  91. data/_sass/partials/_web-fitting.scss +16 -0
  92. data/_sass/partials/_web-footer.scss +38 -0
  93. data/_sass/partials/_web-index.scss +21 -0
  94. data/_sass/partials/_web-maths.scss +9 -0
  95. data/_sass/partials/_web-nav-bar.scss +70 -0
  96. data/_sass/partials/_web-notes.scss +58 -0
  97. data/_sass/partials/_web-openers.scss +5 -0
  98. data/_sass/partials/_web-pullquotes.scss +9 -0
  99. data/_sass/partials/_web-quotations.scss +6 -0
  100. data/_sass/partials/_web-reset-sequences.scss +27 -0
  101. data/_sass/partials/_web-smallcaps.scss +21 -0
  102. data/_sass/partials/_web-tables.scss +45 -0
  103. data/_sass/partials/_web-title-page.scss +35 -0
  104. data/_sass/partials/_web-toc.scss +41 -0
  105. data/_sass/partials/_web-valedictions.scss +9 -0
  106. data/_sass/partials/_web-verse.scss +138 -0
  107. data/_sass/partials/_web-video.scss +24 -0
  108. data/_sass/partials/_web-wrappers.scss +14 -0
  109. data/_sass/print-pdf.scss +194 -0
  110. data/_sass/screen-pdf.scss +216 -0
  111. data/_sass/web.scss +98 -0
  112. data/electric-book-classic-theme.gemspec +19 -0
  113. data/index.md +7 -0
  114. data/screenshot.png +0 -0
  115. metadata +208 -0
@@ -0,0 +1,150 @@
1
+ // Styling of headers and footers
2
+
3
+ // Let's define our header typography as a mixin
4
+ // Note we don't set margins here.
5
+ // By default the header will center vertically in the margin box.
6
+ // Control its position with `vertical-align: top` and then `margin-top`.
7
+
8
+ @mixin header-style() {
9
+ font-family: $font-text-main;
10
+ font-size: $font-size-default * 0.8;
11
+ text-transform: uppercase;
12
+ letter-spacing: 0.05em;
13
+ font-variant: prince-opentype(c2sc,smcp,onum); // If the font supports true small caps, this will look better
14
+ }
15
+
16
+ // Verso
17
+ @page chapter:left {
18
+ @top {
19
+ @include header-style();
20
+ }
21
+ @top-right {
22
+ @include header-style();
23
+ }
24
+ @top-left {
25
+ @include header-style();
26
+ }
27
+ @top-right-corner {
28
+ @include header-style();
29
+ }
30
+ @top-left-corner {
31
+ @include header-style();
32
+ }
33
+ @bottom {
34
+ @include header-style();
35
+ }
36
+ @bottom-left {
37
+ @include header-style();
38
+ }
39
+ @bottom-right {
40
+ @include header-style();
41
+ }
42
+ @bottom-left-corner {
43
+ @include header-style();
44
+ }
45
+ @bottom-right-corner {
46
+ @include header-style();
47
+ }
48
+ }
49
+
50
+ // Recto
51
+ @page chapter:right {
52
+ @top {
53
+ @include header-style();
54
+ }
55
+ @top-right {
56
+ @include header-style();
57
+ }
58
+ @top-left {
59
+ @include header-style();
60
+ }
61
+ @top-right-corner {
62
+ @include header-style();
63
+ }
64
+ @top-left-corner {
65
+ @include header-style();
66
+ }
67
+ @bottom {
68
+ @include header-style();
69
+ }
70
+ @bottom-left {
71
+ @include header-style();
72
+ }
73
+ @bottom-right {
74
+ @include header-style();
75
+ }
76
+ @bottom-left-corner {
77
+ @include header-style();
78
+ }
79
+ @bottom-right-corner {
80
+ @include header-style();
81
+ }
82
+ }
83
+
84
+ // Verso
85
+ @page frontmatter:left {
86
+ @top {
87
+ @include header-style();
88
+ }
89
+ @top-right {
90
+ @include header-style();
91
+ }
92
+ @top-left {
93
+ @include header-style();
94
+ }
95
+ @top-right-corner {
96
+ @include header-style();
97
+ }
98
+ @top-left-corner {
99
+ @include header-style();
100
+ }
101
+ @bottom {
102
+ @include header-style();
103
+ }
104
+ @bottom-left {
105
+ @include header-style();
106
+ }
107
+ @bottom-right {
108
+ @include header-style();
109
+ }
110
+ @bottom-left-corner {
111
+ @include header-style();
112
+ }
113
+ @bottom-right-corner {
114
+ @include header-style();
115
+ }
116
+ }
117
+
118
+ // Recto
119
+ @page frontmatter:right {
120
+ @top {
121
+ @include header-style();
122
+ }
123
+ @top-right {
124
+ @include header-style();
125
+ }
126
+ @top-left {
127
+ @include header-style();
128
+ }
129
+ @top-right-corner {
130
+ @include header-style();
131
+ }
132
+ @top-left-corner {
133
+ @include header-style();
134
+ }
135
+ @bottom {
136
+ @include header-style();
137
+ }
138
+ @bottom-left {
139
+ @include header-style();
140
+ }
141
+ @bottom-right {
142
+ @include header-style();
143
+ }
144
+ @bottom-left-corner {
145
+ @include header-style();
146
+ }
147
+ @bottom-right-corner {
148
+ @include header-style();
149
+ }
150
+ }
@@ -0,0 +1,43 @@
1
+ /* Set up our basic page margins */
2
+ @page {
3
+ size: $page-size;
4
+ margin-top: $margin-top;
5
+ margin-bottom: $margin-bottom;
6
+ margin-outside: $margin-outside;
7
+ margin-inside: $margin-inside;
8
+ padding: 0;
9
+ marks: $crop-marks;
10
+ prince-bleed: $bleed;
11
+ prince-trim: $trim;
12
+ }
13
+ /* Name our book-part styles as divs. PrinceXML needs the pages named for @page rules. */
14
+ .title-page {
15
+ page: title-page;
16
+ }
17
+ .halftitle-page {
18
+ page: halftitle-page;
19
+ }
20
+ .previous-publications-page {
21
+ page: previous-publications-page;
22
+ }
23
+ .copyright-page {
24
+ page: copyright-page;
25
+ }
26
+ .dedication-page {
27
+ page: dedication-page;
28
+ }
29
+ .frontispiece-page {
30
+ page: frontispiece-page;
31
+ }
32
+ .chapter {
33
+ page: chapter;
34
+ }
35
+ .contents-page {
36
+ page: contents-page;
37
+ }
38
+ .cover {
39
+ page: cover;
40
+ }
41
+ .frontmatter {
42
+ page: frontmatter; /* Use for any other frontmatter */
43
+ }
@@ -0,0 +1,4 @@
1
+ /* Start these layouts with a big top margin */
2
+ .halftitle-page, .title-page, .dedication-page, .epigraph-page, .contents-page, .chapter {
3
+ margin-top: $start-depth;
4
+ }
@@ -0,0 +1,42 @@
1
+ // Set the initial default view when this PDF is opened. See http://www.princexml.com/forum/topic/2650/prince-pdf
2
+ @prince-pdf {
3
+ prince-pdf-open-action: command(FitPage); // none | print | command(NamedAction) See http://www.planetpdf.com/planetpdf/pdfs/A4NamedActions.pdf
4
+ prince-pdf-page-layout: two-page-right; // single-page snaps to single pages | one-column scrolls single pages| two-column | two-column-left | two-column-right | two-page-left for no cover page | two-page-right to show cover page
5
+ prince-pdf-page-mode: show-bookmarks; // auto | show-attachments | show-bookmarks | fullscreen
6
+ prince-pdf-paper-tray: auto; // auto | pick-tray-by-pdf-size
7
+ prince-pdf-print-scaling: auto; // auto | none
8
+ prince-pdf-script: ""; // Insert Javascript between the quotes if needed: http://www.princexml.com/doc/properties/prince-pdf-script/
9
+ prince-pdf-color-options: use-#{$black-ink}-black; // takes two values, use-true-black (/DeviceGray black in the PDF) and use-rich-black (/DeviceRGB black in PDF)
10
+ }
11
+
12
+ // Make the PDF page labels (numbers in PDF navigation) match the numbers of the book pages
13
+ @page cover {
14
+ prince-pdf-page-label: counter(page, lower-alpha);
15
+ }
16
+ @page halftitle-page {
17
+ prince-pdf-page-label: counter(page, $frontmatter-reference-style);
18
+ }
19
+ @page title-page {
20
+ prince-pdf-page-label: counter(page, $frontmatter-reference-style);
21
+ }
22
+ @page previous-publications-page {
23
+ prince-pdf-page-label: counter(page, $frontmatter-reference-style);
24
+ }
25
+ @page copyright-page {
26
+ prince-pdf-page-label: counter(page, $frontmatter-reference-style);
27
+ }
28
+ @page frontispiece-page {
29
+ prince-pdf-page-label: counter(page, $frontmatter-reference-style);
30
+ }
31
+ @page dedication-page {
32
+ prince-pdf-page-label: counter(page, $frontmatter-reference-style);
33
+ }
34
+ @page contents-page {
35
+ prince-pdf-page-label: counter(page, $frontmatter-reference-style);
36
+ }
37
+ @page frontmatter {
38
+ prince-pdf-page-label: counter(page, $frontmatter-reference-style);
39
+ }
40
+ @page chapter {
41
+ prince-pdf-page-label: counter(page);
42
+ }
@@ -0,0 +1,13 @@
1
+ // Pull quotes
2
+
3
+ .pullquote {
4
+ text-indent: 0;
5
+ font-size: $font-size-default * 2;
6
+ font-style: italic;
7
+ text-align: center;
8
+ margin: $line-height-default 0;
9
+ line-height: $line-height-default * 2;
10
+ }
11
+ .pullquote + p {
12
+ text-indent: 0;
13
+ }
@@ -0,0 +1,6 @@
1
+ p.source {
2
+ text-align: right;
3
+ max-width: 22.5em;
4
+ margin: 0 0 0 25%;
5
+ page-break-before: avoid;
6
+ }
@@ -0,0 +1,27 @@
1
+ // After certain elements, don't indent paragraphs
2
+ // and remove any top-margin inadvertently added with .first or similar
3
+
4
+ h1 + p, // Paragraphs after headings
5
+ h2 + p,
6
+ h3 + p,
7
+ h4 + p,
8
+ h5 + p,
9
+ h6 + p,
10
+ blockquote + p, // Paragraphs after blockquotes
11
+ ol + p, // Paragraphs after ordered lists
12
+ ul + p, // Paragraphs after unordered lists
13
+ dl + p, // Paragraphs after definition lists
14
+ pre + p, // Paragraphs after code blocks
15
+ h1 + p.sidenote + p, // Paragraphs after headings with a sidenote in between
16
+ h2 + p.sidenote + p,
17
+ h3 + p.sidenote + p,
18
+ h4 + p.sidenote + p,
19
+ h5 + p.sidenote + p,
20
+ h6 + p.sidenote + p,
21
+ .box + p.sidenote + p, // Paragraphs after boxes with a sidenote in between
22
+ table + p.sidenote + p, // Paragraphs after tables with a sidenote in between
23
+ .pullquote + p // Paragraphs after pullquotes
24
+ {
25
+ text-indent: 0;
26
+ margin-top: 0;
27
+ }
@@ -0,0 +1,29 @@
1
+ // Use small-cap alternate glyphs
2
+ .smallcaps {
3
+ letter-spacing: 0.025em;
4
+ font-variant: prince-opentype(smcp, onum);
5
+ font-style: inherit;
6
+ font-weight: inherit;
7
+ line-height: 100%;
8
+ &.italic {
9
+ font-style: italic;
10
+ }
11
+ &.bold {
12
+ font-weight: bold;
13
+ }
14
+ }
15
+
16
+ // Convert both upper and lowercase to small caps (affects punctuation also)
17
+ .allsmallcaps {
18
+ letter-spacing: 0.025em;
19
+ font-variant: prince-opentype(c2sc, smcp, onum);
20
+ font-style: inherit;
21
+ font-weight: inherit;
22
+ line-height: 100%;
23
+ &.italic {
24
+ font-style: italic;
25
+ }
26
+ &.bold {
27
+ font-weight: bold;
28
+ }
29
+ }
@@ -0,0 +1,28 @@
1
+ // Halftitle and title pages will always start on a right
2
+ .halftitle-page,
3
+ .title-page {
4
+ page-break-before: right;
5
+ }
6
+
7
+ // By default, these page styles start on right-hand pages only
8
+ .frontmatter,
9
+ .dedication-page,
10
+ .epigraph-page,
11
+ .contents-page,
12
+ .chapter {
13
+ page-break-before: right;
14
+ }
15
+
16
+ // But they can be overriden by the $start-on variable
17
+ .frontmatter,
18
+ .dedication-page,
19
+ .epigraph-page,
20
+ .contents-page,
21
+ .chapter
22
+ {
23
+ page-break-before: $start-on;
24
+ }
25
+
26
+ // Also see:
27
+ // _print-page-break-tools.scss
28
+ // _print-front-cover.scss
@@ -0,0 +1,48 @@
1
+ /*
2
+ * Tables
3
+ */
4
+
5
+ table {
6
+ border-collapse: collapse;
7
+ margin: $line-height-default 0;
8
+ font-size: $font-size-default * 0.8;
9
+ font-variant: prince-opentype(tnum);
10
+ }
11
+ th, td {
12
+ border-top: 0.5pt solid #ccc;
13
+ border-bottom: 0.5pt solid #ccc;
14
+ border-left: 0.5pt dotted #f2f2f2;
15
+ border-right: 0.5pt dotted #f2f2f2;
16
+ padding: ($line-height-default * 0.1) ($line-height-default * 0.2);
17
+ }
18
+ thead, th {
19
+ font-weight: bold;
20
+ }
21
+ .table-caption {
22
+ page-break-after:avoid;
23
+ font-style: italic;
24
+ text-indent: 0;
25
+ margin: ($line-height-default * 2) 0 $line-height-default 0;
26
+ }
27
+ .table-caption em {
28
+ font-style: normal;
29
+ }
30
+ td {
31
+ vertical-align: top;
32
+ page-break-inside: avoid;
33
+ }
34
+ td p {
35
+ font-variant: prince-opentype(tnum);
36
+ }
37
+ thead, th, .table-subhead {
38
+ page-break-after: avoid;
39
+ background-color: #F2F2F2;
40
+ line-height: 120%;
41
+ }
42
+ .table-row-stub {
43
+ font-weight: bold;
44
+ }
45
+ td p {
46
+ margin: 0;
47
+ padding: 0;
48
+ }
@@ -0,0 +1,59 @@
1
+ /*
2
+ * Halftitle-page and title-page
3
+ */
4
+
5
+ .title-page, .halftitle-page {
6
+ margin-right: auto;
7
+ margin-left: auto;
8
+ }
9
+ .title-page p {
10
+ text-indent: 0;
11
+ hyphens: none;
12
+ text-align: center;
13
+ }
14
+ .title-page-title {
15
+ font-size: $font-size-default * 3;
16
+ line-height: $line-height-default * 3;
17
+ font-variant: prince-opentype(dlig);
18
+ margin: ($line-height-default * 6) 0 $line-height-default 0;
19
+ string-set: book-title content ();
20
+ }
21
+ .title-page-subtitle {
22
+ font-size: $font-size-default * 2;
23
+ line-height: $line-height-default * 2;
24
+ font-style: italic;
25
+ margin: $line-height-default 0 $line-height-default 0;
26
+ font-variant: prince-opentype(dlig);
27
+ string-set: book-subtitle content ();
28
+ }
29
+ .title-page-author {
30
+ font-size: $font-size-default * 2;
31
+ line-height: $line-height-default * 2;
32
+ margin: $line-height-default 0;
33
+ font-variant: prince-opentype(dlig);
34
+ string-set: book-author content ();
35
+ }
36
+ .title-page-publisher {
37
+ position: absolute;
38
+ bottom: 0;
39
+ text-align: center;
40
+ text-indent: 0;
41
+ font-size: $font-size-default;
42
+ line-height: $line-height-default;
43
+ margin: $line-height-default 0;
44
+ // Now we'll center the block on the page
45
+ transform: translateX(-50%);
46
+ margin-left: 50%;
47
+ }
48
+ .title-page-logo {
49
+ width: 3em;
50
+ position: absolute;
51
+ text-align: center;
52
+ bottom: 0;
53
+ // Now we'll center the block on the page
54
+ transform: translateX(-50%);
55
+ margin-left: 50%;
56
+ }
57
+ .title-page-logo img {
58
+ width: 100%;
59
+ }