|
|
|
img { image-resolution: auto, 300dpi; } |
|
* { background-image-resolution: auto, 300dpi; } |
|
|
|
/***** metric-dependent stuffs *****/ |
|
|
|
/* |
|
I personally convert rem to actual length units by scaling |
|
down from a 1000px (its max-width of <body>) wide viewport |
|
|
|
2.5 7 2 ? 2.5 (rem) |
|
+--------------------------------+ |
|
| | 3 |
|
| +-------+ +------------+ | |
|
| | ..... | | xxxxx... | | |
|
| | ..... | | | | |
|
= - - - - = |
|
^^^^^^^ side note |
|
|
|
so we simply get the factor: 1000 px -> 5.8 inches, and |
|
it looks really well when font size is set to 12-14px. |
|
|
|
(read the 4th point of "Typography in Ten Minutes" to see |
|
why I said this) |
|
*/ |
|
|
|
html { font-size: 13px; } |
|
|
|
@page { |
|
size: A5; /* 5.8in x 8.3in */ |
|
|
|
margin-top: .518in; /* 72px + .1in */ |
|
margin-bottom: .318in; /* 72px - .1in */ |
|
|
|
margin-inside: .35in; /* ~60px */ |
|
margin-outside: 1.6in; /* ~276px */ |
|
|
|
padding-top: .1in; |
|
|
|
@footnotes { |
|
/*border-top: solid #777 thin;*/ |
|
margin-top: .15in; |
|
max-height: 8in; |
|
} |
|
} |
|
|
|
@page cover { |
|
margin: .2in; /* casaual */ |
|
padding: 0; |
|
} |
|
|
|
@page:left { |
|
@top-right { font-size: 12px; } |
|
@top-left-corner { font-size: 14px; margin-outside: .25in; } |
|
} |
|
|
|
@page:right { |
|
@top-left { font-size: 12px; } |
|
@top-right-corner { font-size: 14px; margin-outside: .25in; } |
|
} |
|
|
|
/* delicated side notes (be careful since they are fragile) */ |
|
title-block, aside { |
|
/* width 0.974in |
|
gut 0.276in |
|
reset the metrics caused by a bug where negative |
|
width object will collapse in float environments */ |
|
width: .974in; |
|
margin-outside: -1.25in; |
|
margin-inside: .276001in; |
|
/*width: 1.526001in;*/ |
|
/*border-left: .276in solid transparent;*/ |
|
/*border-right: .276in solid transparent;*/ |
|
} |
|
|
|
/* fix on margin-collapsing on indented elements */ |
|
li aside { |
|
/* add .17in (32.5px ~= .34in, make it half) */ |
|
/* that way, side notes on the right will be unaffected |
|
but those on the left will be shift by the amount twice */ |
|
margin-outside: -1.42in; |
|
margin-inside: .446001in; |
|
right: .17in; |
|
} |
|
|
|
/***** page definitions *****/ |
|
@page:left { |
|
@top-right { |
|
content: counter(chapter) '\2003' string(chapter-title); |
|
font-family: 'equity-caps'; |
|
text-transform: lowercase; |
|
} |
|
|
|
@top-left-corner { |
|
text-align: left; |
|
content: counter(page); |
|
font-family: 'concourse-t3'; |
|
font-weight: 700; |
|
} |
|
} |
|
|
|
@page:right { |
|
@top-left { |
|
content: counter(chapter) '.' counter(section) '\2003' string(section-title); |
|
font-family: 'equity-caps'; |
|
text-transform: lowercase; |
|
} |
|
|
|
@top-right-corner { |
|
text-align: right; |
|
content: counter(page); |
|
font-family: 'concourse-t3'; |
|
font-weight: 700; |
|
} |
|
} |
|
|
|
@page cover{ |
|
@top-left-corner { content: normal; } |
|
@top-right-corner { content: normal; } |
|
} |
|
|
|
@page:first:left { @top-right { content: normal; } } |
|
@page:first:right { @top-left { content: normal; } } |
|
|
|
@page toc:left { |
|
@top-right { content: 'table of content'; } |
|
@top-left-corner { content: counter(page, upper-roman); } |
|
} |
|
@page toc:right { |
|
@top-left { content: 'table of content'; } |
|
@top-right-corner { content: counter(page, upper-roman); } |
|
} |
|
|
|
@page partBeforeMain:left { @top-right { content: string(chapter-title); } } |
|
@page partBeforeMain:right { @top-left { content: string(chapter-title); } } |
|
|
|
@page partAppendix:left { @top-right { content: 'appendix'; } } |
|
@page partAppendix:right { @top-left { content: 'A.' counter(section) '\2003' string(section-title); } } |
|
|
|
@page endCredits:left { @top-right { content: 'end credits'; } } |
|
@page endCredits:right { @top-left { content: 'end credits'; } } |
|
|
|
@page blank, :blank { |
|
@top-left { content: normal; } |
|
@top-left-corner { content: normal; } |
|
@top-right { content: normal; } |
|
@top-right-corner { content: normal; } |
|
} |
|
|
|
/* holy debugging zone */ |
|
/* |
|
@page partBeforeMain:left { background-color: red; } |
|
@page partBeforeMain:right { background-color: green; } |
|
@page blank { background: black; } |
|
@page content { background: yellow; } |
|
@page cover { background: purple; } |
|
*/ |
|
|
|
/***** styles.css override BEGIN *****/ |
|
body > * { |
|
margin-left: 0 !important; |
|
margin-right: 0 !important; |
|
} |
|
|
|
div.content { |
|
display: block; |
|
padding: 0; |
|
} |
|
|
|
body { |
|
/* the original css has it wrong */ |
|
-moz-font-feature-settings: 'kern=1', 'liga=1'; |
|
-moz-font-feature-settings: 'kern' 1, 'liga' 1; |
|
-webkit-font-feature-settings: 'kern' 1, 'liga' 1; |
|
-o-font-feature-settings: 'kern' 1, 'liga' 1; |
|
-ms-font-feature-settings: 'kern' 1, 'liga' 1; |
|
font-feature-settings: 'kern' 1, 'liga' 1; |
|
} |
|
|
|
/* princeXML doesn't support `font-feature-settings` for now, |
|
but it supports `font-variant` with `prince-` prefixed flavor |
|
not knowing if it works */ |
|
body { |
|
font-variant: prince-opentype(kern, liga); |
|
} |
|
|
|
sig, |
|
.subhead, .howto-name, |
|
program, |
|
a.xref, |
|
toc-topic { |
|
font-variant: prince-opentype(c2sc); |
|
} |
|
|
|
ol li { |
|
font-variant: prince-opentype(liga, ss01 off); |
|
} |
|
|
|
.btw-title, |
|
a.specimen, table.buy-table td a, a.direct-payment { |
|
font-variant: prince-opentype(case); |
|
} |
|
|
|
a.__ext_link_default__ { |
|
/* there is no hover effect in a PDF */ |
|
/* only affect unhandled && unstyled links */ |
|
background: #fbf3f3; |
|
border-radius: 4px; |
|
} |
|
|
|
title-block, aside { |
|
position: relative; |
|
float: outside; |
|
left: auto; |
|
text-align: inside !important; |
|
display: block; |
|
overflow: auto; |
|
box-sizing: border-box; |
|
} |
|
|
|
aside.__old_float_method__ { |
|
position: absolute; |
|
right: 0; |
|
margin-outside: 0; |
|
margin-inside: 0; |
|
} |
|
|
|
/* to fix the nasty border-top issue; no longer needed */ |
|
/*title-block:before, title-block:after { |
|
content: ''; |
|
display: block; |
|
position: absolute; |
|
background: white; |
|
height: 4px; |
|
width: .276in; |
|
top: -3px; |
|
} |
|
title-block:before { left: -.276in; } |
|
title-block:after { right: -.276in; }*/ |
|
|
|
/***** styles.css override END *****/ |
|
|
|
/***** page breaking policy *****/ |
|
.__page_toc__ { page-break-after: right; } |
|
.__chapter__ { page-break-after: right; prince-page-group: start; } |
|
.__page_partBeforeMain__ .__chapter__ { page-break-after: always; } |
|
.__section__ { page-break-after: always; } |
|
|
|
topic { |
|
page-break-inside: avoid; |
|
page-break-after: avoid; |
|
} |
|
|
|
.btw-title, |
|
.subhead, |
|
.howto-name { |
|
page-break-after: avoid; |
|
} |
|
|
|
.btw li, |
|
#the-infinite-pixel-screen\.html table { |
|
page-break-inside: avoid; |
|
} |
|
|
|
/***** book structure *****/ |
|
.__blank__ { page: blank; } |
|
.__page_cover__ { page: cover; } |
|
.__page_toc__ { page: toc; } |
|
.__page_partBeforeMain__ { page: partBeforeMain; } |
|
.__page_appendix__ { page: partAppendix; } |
|
.__page_endCredits__ { page: endCredits; } |
|
|
|
.__reset_page_number__ { counter-reset: page 1; } |
|
/*.__reset_chapter_number__ { counter-reset: chapter; }*/ |
|
|
|
.__chapter__ { |
|
counter-increment: chapter; |
|
counter-reset: section; |
|
} |
|
|
|
.__section__ { |
|
counter-increment: section; |
|
} |
|
|
|
/* do not increment a counter for the first section of each chapter */ |
|
.__chapter__ .__section__:first-child { |
|
counter-increment: none; |
|
} |
|
|
|
.__chapter__ .__section__:first-child topic { |
|
string-set: chapter-title content(), section-title content(); |
|
} |
|
|
|
.__chapter__ .__section__:first-child { |
|
bookmark-label: attr(data-title); |
|
bookmark-state: closed; |
|
bookmark-level: 1; |
|
} |
|
|
|
.__section__ topic { |
|
string-set: section-title content(); |
|
} |
|
|
|
.__section__ { |
|
bookmark-label: attr(data-title); |
|
bookmark-level: 2; |
|
/*margin-bottom: .418in;*/ |
|
margin-bottom: .627in; |
|
} |
|
|
|
.__page_cover__ { |
|
bookmark-label: 'Cover'; |
|
bookmark-level: 1; |
|
} |
|
|
|
.__page_toc__ { |
|
bookmark-label: 'Table of Content'; |
|
bookmark-level: 1; |
|
} |
|
|
|
.__page_appendix__ { |
|
counter-reset: section; |
|
} |
|
|
|
.__page_endCredits__ topic { |
|
bookmark-label: content(); |
|
bookmark-level: 2; |
|
} |
|
|
|
/* hide foot notes as default */ |
|
.__footnote__ { display: none; } |
|
|
|
/********************************************************/ |
|
/******** link-to-foot-note convertion for books ********/ |
|
/******** remove lines below when making e-books ********/ |
|
/********************************************************/ |
|
|
|
.__section__ { counter-reset: footnote; } |
|
|
|
.__footnote__ { |
|
display: initial; |
|
font: initial; |
|
float: footnote; |
|
word-break: break-all; |
|
text-align: left; |
|
color: #777; |
|
font-family: 'equity-text'; |
|
font-size: 8px; |
|
line-height: 1; |
|
} |
|
|
|
.__footnote__::footnote-call { |
|
/* from the lovely circle */ |
|
position: relative; |
|
color: #933; |
|
font-size: 80%; |
|
top: -1em; |
|
margin-left: .10em; |
|
font-family: 'concourse-t3'; |
|
} |
|
|
|
type-specimen .__footnote__ { |
|
display: none; |
|
} |
|
|
|
a { |
|
background: initial; |
|
border-radius: initial; |
|
} |
|
|
|
a:after { |
|
content: ''; |
|
} |
|
|
|
a.xref.__show_page_hint__ { |
|
/* don't break page with a page number */ |
|
page-break-inside: avoid; |
|
} |
|
|
|
a.xref.__show_page_hint__:after { |
|
font-size: 50%; |
|
position: relative; |
|
top: -.6em; |
|
margin-left: .10em; |
|
font-family: 'concourse-t3'; |
|
content: 'p.\00a0' target-counter(attr(href), page); |
|
/*content: '\00a0(' target-counter(attr(href), chapter) '.' target-counter(attr(href), section) ')';*/ |
|
} |
|
|
|
a.toc.__show_page_hint__:after, |
|
ul.children a.xref.__show_page_hint__:after { |
|
position: static; |
|
color: inherit; |
|
font-size: 100%; |
|
content: leader('.') target-counter(attr(href), page); |
|
} |
|
|
|
.__page_toc__ toc-topic a.toc.__show_page_hint__:after { |
|
content: leader('') target-counter(attr(href), page); |
|
} |
|
|
|
.content ul.children a.xref.__show_page_hint__:after { |
|
font-family: 'equity-caps'; |
|
} |
|
|
|
/* style on disabled links on (main or per-chapter) TOC |
|
__show_page_hint__ class is not applied on 'em ever when processing |
|
so no need to override content of its :after |
|
|
|
you can hide them but I don't recommend that |
|
you can add back the red background (and that will be lovely indeed >///<) |
|
*/ |
|
|
|
.__page_toc__ toc-topic a.toc.__link_disabled__ { } |
|
.content ul.children a.xref.__link_disabled__ { color: #667; } |