|
| 1 | +/* GIT Going with GitHub — PDF Stylesheet (WeasyPrint) */ |
| 2 | + |
| 3 | +@page { |
| 4 | + size: letter; |
| 5 | + margin: 2.5cm 2cm 2.5cm 2cm; |
| 6 | + @bottom-center { |
| 7 | + content: counter(page); |
| 8 | + font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; |
| 9 | + font-size: 0.8em; |
| 10 | + color: #6b7280; |
| 11 | + } |
| 12 | +} |
| 13 | + |
| 14 | +/* ---- Body & typography ---- */ |
| 15 | +body { |
| 16 | + font-family: Georgia, "Times New Roman", serif; |
| 17 | + font-size: 11pt; |
| 18 | + line-height: 1.7; |
| 19 | + color: #1a1a1a; |
| 20 | +} |
| 21 | + |
| 22 | +/* ---- Headings ---- */ |
| 23 | +h1, h2, h3, h4, h5, h6 { |
| 24 | + font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; |
| 25 | + font-weight: 700; |
| 26 | + line-height: 1.3; |
| 27 | + margin-top: 1.5em; |
| 28 | + margin-bottom: 0.5em; |
| 29 | + page-break-after: avoid; |
| 30 | +} |
| 31 | + |
| 32 | +h1 { |
| 33 | + font-size: 20pt; |
| 34 | + border-bottom: 2px solid #1a1a1a; |
| 35 | + padding-bottom: 0.3em; |
| 36 | + page-break-before: always; |
| 37 | +} |
| 38 | + |
| 39 | +h1:first-child { |
| 40 | + page-break-before: avoid; |
| 41 | +} |
| 42 | + |
| 43 | +h2 { font-size: 15pt; } |
| 44 | +h3 { font-size: 12pt; } |
| 45 | +h4 { font-size: 11pt; font-style: italic; } |
| 46 | + |
| 47 | +/* ---- Paragraphs ---- */ |
| 48 | +p { |
| 49 | + margin-top: 0; |
| 50 | + margin-bottom: 0.9em; |
| 51 | + orphans: 3; |
| 52 | + widows: 3; |
| 53 | +} |
| 54 | + |
| 55 | +/* ---- Links ---- */ |
| 56 | +a { |
| 57 | + color: #0550ae; |
| 58 | + text-decoration: underline; |
| 59 | +} |
| 60 | + |
| 61 | +/* Print URLs after external links */ |
| 62 | +a[href^="http"]::after { |
| 63 | + content: " (" attr(href) ")"; |
| 64 | + font-size: 0.8em; |
| 65 | + color: #6b7280; |
| 66 | + word-break: break-all; |
| 67 | +} |
| 68 | + |
| 69 | +/* ---- Code ---- */ |
| 70 | +code, kbd, samp { |
| 71 | + font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; |
| 72 | + font-size: 0.88em; |
| 73 | + background: #f3f4f6; |
| 74 | + padding: 0.1em 0.3em; |
| 75 | + border-radius: 3px; |
| 76 | +} |
| 77 | + |
| 78 | +pre { |
| 79 | + font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; |
| 80 | + font-size: 0.8em; |
| 81 | + background: #f3f4f6; |
| 82 | + border: 1px solid #d1d5db; |
| 83 | + border-radius: 4px; |
| 84 | + padding: 0.8em; |
| 85 | + white-space: pre-wrap; |
| 86 | + word-break: break-word; |
| 87 | + page-break-inside: avoid; |
| 88 | +} |
| 89 | + |
| 90 | +pre code { |
| 91 | + background: none; |
| 92 | + padding: 0; |
| 93 | + border-radius: 0; |
| 94 | + font-size: 1em; |
| 95 | +} |
| 96 | + |
| 97 | +/* ---- Blockquotes ---- */ |
| 98 | +blockquote { |
| 99 | + margin: 1em 0 1em 1.5em; |
| 100 | + padding-left: 1em; |
| 101 | + border-left: 3px solid #9ca3af; |
| 102 | + color: #4b5563; |
| 103 | + font-style: italic; |
| 104 | +} |
| 105 | + |
| 106 | +/* ---- Lists ---- */ |
| 107 | +ul, ol { |
| 108 | + margin: 0.5em 0 0.9em 1.5em; |
| 109 | + padding: 0; |
| 110 | +} |
| 111 | + |
| 112 | +li { |
| 113 | + margin-bottom: 0.3em; |
| 114 | +} |
| 115 | + |
| 116 | +/* ---- Tables ---- */ |
| 117 | +table { |
| 118 | + width: 100%; |
| 119 | + border-collapse: collapse; |
| 120 | + margin: 1em 0; |
| 121 | + font-size: 0.88em; |
| 122 | + page-break-inside: avoid; |
| 123 | +} |
| 124 | + |
| 125 | +th, td { |
| 126 | + border: 1px solid #d1d5db; |
| 127 | + padding: 0.4em 0.6em; |
| 128 | + text-align: left; |
| 129 | + vertical-align: top; |
| 130 | +} |
| 131 | + |
| 132 | +th { |
| 133 | + background: #f3f4f6; |
| 134 | + font-weight: 700; |
| 135 | +} |
| 136 | + |
| 137 | +tr:nth-child(even) td { |
| 138 | + background: #fafafa; |
| 139 | +} |
| 140 | + |
| 141 | +/* ---- Horizontal rules ---- */ |
| 142 | +hr { |
| 143 | + border: none; |
| 144 | + border-top: 1px solid #d1d5db; |
| 145 | + margin: 1.5em 0; |
| 146 | +} |
| 147 | + |
| 148 | +/* ---- Images ---- */ |
| 149 | +img { |
| 150 | + max-width: 100%; |
| 151 | + height: auto; |
| 152 | +} |
0 commit comments