|
| 1 | +/* A wrapper for styling the markup generated by MarkupRenderer. */ |
| 2 | + |
| 3 | +sdoc-autogen { |
| 4 | + /* |
| 5 | + TODO: 'display: contents;' |
| 6 | + Turn this back on when the bug is fixed: |
| 7 | + Selenium cannot detect text inside a container |
| 8 | + with the 'display: contents;' directive |
| 9 | + */ |
| 10 | + /* display: contents; */ |
| 11 | + |
| 12 | + /* hyphens: auto; */ |
| 13 | + |
| 14 | + --autogen-v-rhythm: calc(var(--base-rhythm, 8px) * 2); |
| 15 | +} |
| 16 | + |
| 17 | +sdoc-autogen a, |
| 18 | +sdoc-autogen a:link, |
| 19 | +sdoc-autogen a:visited { |
| 20 | + text-decoration: underline; |
| 21 | +} |
| 22 | + |
| 23 | +/* Table */ |
| 24 | + |
| 25 | +sdoc-autogen table { |
| 26 | + border-collapse: collapse; |
| 27 | + margin: var(--base-padding) 0; |
| 28 | + font-size: 1rem; |
| 29 | + |
| 30 | + /*** add scroll for wide tables */ |
| 31 | + /* issue#1370 https://css-tricks.com/preventing-a-grid-blowout/ */ |
| 32 | + /* border: 1px solid #ccc; */ |
| 33 | + border: none; |
| 34 | + display: block; |
| 35 | + overflow-x: auto; |
| 36 | + white-space: nowrap; |
| 37 | +} |
| 38 | + |
| 39 | +sdoc-autogen table caption { |
| 40 | + font-weight: bold; |
| 41 | + padding-bottom: 1rem; |
| 42 | +} |
| 43 | + |
| 44 | +sdoc-autogen table th { |
| 45 | + background-color: var(--color-bg-main); |
| 46 | +} |
| 47 | + |
| 48 | +sdoc-autogen table th, |
| 49 | +sdoc-autogen table td { |
| 50 | + padding: var(--base-rhythm) calc(var(--base-rhythm) * 1.5); |
| 51 | + vertical-align: top; |
| 52 | + text-align: left; |
| 53 | + border: 1px solid #ccc; |
| 54 | + |
| 55 | + /* issue#1370 https://css-tricks.com/preventing-a-grid-blowout/ */ |
| 56 | + /*** add scroll for wide tables (unset) */ |
| 57 | + white-space: initial; |
| 58 | +} |
| 59 | + |
| 60 | +/* Typography */ |
| 61 | + |
| 62 | +sdoc-autogen p { |
| 63 | + margin: var(--autogen-v-rhythm) 0; |
| 64 | +} |
| 65 | + |
| 66 | +/* blockquote */ |
| 67 | + |
| 68 | +sdoc-autogen blockquote { |
| 69 | + color: #666; |
| 70 | + padding: .25em 0 0.25em 1rem; |
| 71 | + border-left: 4px solid #ccc; |
| 72 | + margin: var(--autogen-v-rhythm) 0; |
| 73 | +} |
| 74 | + |
| 75 | +/* pre.code */ |
| 76 | + |
| 77 | +sdoc-autogen pre.code { |
| 78 | + font-family: var(--code-font-family); |
| 79 | + |
| 80 | + font-size: var(--code-font-size); |
| 81 | + line-height: 2; |
| 82 | + margin: var(--code-font-size) 0; |
| 83 | + padding: calc(var(--code-font-size)*1) |
| 84 | + calc(var(--code-font-size)*1) |
| 85 | + calc(var(--code-font-size)*1) |
| 86 | + calc(var(--code-font-size)*2); |
| 87 | + |
| 88 | + overflow: auto; |
| 89 | + background-color: var(--color-bg-main); |
| 90 | + border: 1px solid var(--color-border); |
| 91 | +} |
| 92 | + |
| 93 | +/* We have to override this for the print version because the printer |
| 94 | + interprets scroll-bars differently in different environments, |
| 95 | + which breaks HTML2PDF. |
| 96 | + Also, we need to show the whole code in its entirety. |
| 97 | + */ |
| 98 | +[html2pdf] sdoc-autogen pre.code { |
| 99 | + overflow: unset; |
| 100 | + white-space: pre-wrap; |
| 101 | + overflow-wrap: break-word; |
| 102 | +} |
| 103 | + |
| 104 | +/* ``some text`` is generated into: <tt class="docutils literal"> by docutils. */ |
| 105 | +sdoc-autogen tt.literal { |
| 106 | + position: relative; |
| 107 | + padding: 0 4px; |
| 108 | + font-style: normal; |
| 109 | + font-family: var(--code-font-family); |
| 110 | + font-size: var(--code-font-size); |
| 111 | + background-color: var(--color-bg-main); |
| 112 | + border: 1px solid var(--color-border); |
| 113 | + border-radius: 4px; |
| 114 | + |
| 115 | + overflow-wrap: break-word; |
| 116 | + word-wrap: break-word; |
| 117 | + -webkit-box-decoration-break: clone; |
| 118 | + box-decoration-break: clone; |
| 119 | +} |
| 120 | + |
| 121 | +/* ul */ |
| 122 | + |
| 123 | +sdoc-autogen ul, |
| 124 | +sdoc-autogen ol { |
| 125 | + padding-left: 1.6em; |
| 126 | + margin: var(--autogen-v-rhythm) 0; |
| 127 | +} |
| 128 | + |
| 129 | +/* list in table */ |
| 130 | +sdoc-autogen td ul, |
| 131 | +sdoc-autogen dt ol { |
| 132 | + margin: 0; |
| 133 | + padding-left: 1em; |
| 134 | +} |
| 135 | + |
| 136 | +/* object */ |
| 137 | + |
| 138 | +sdoc-autogen img, |
| 139 | +sdoc-autogen object { |
| 140 | + max-width: 100%; |
| 141 | + height: auto; |
| 142 | + padding: 1em; |
| 143 | + background: var(--color-bg-contrast); |
| 144 | +} |
| 145 | + |
| 146 | +/* |
| 147 | + ************************** |
| 148 | + automatically added by RST |
| 149 | + ************************** |
| 150 | +*/ |
| 151 | + |
| 152 | +div.document { |
| 153 | + /* alarm style for detecting unwrapped blocks */ |
| 154 | + border: 1px dashed red; |
| 155 | +} |
| 156 | + |
| 157 | +sdoc-autogen div.document { |
| 158 | + display: contents; |
| 159 | + border: none; |
| 160 | +} |
| 161 | + |
| 162 | +/* block margins */ |
| 163 | + |
| 164 | +sdoc-autogen .document > *:first-child, /* RST */ |
| 165 | +sdoc-autogen > *:first-child { |
| 166 | + margin-top: 0 !important; |
| 167 | +} |
| 168 | + |
| 169 | +sdoc-autogen .document > *:last-child, /* RST */ |
| 170 | +sdoc-autogen > *:last-child { |
| 171 | + margin-bottom: 0 !important; |
| 172 | +} |
| 173 | + |
| 174 | +/* admonition by RST */ |
| 175 | +/* "attention", "caution", "danger", "error", "hint", "important", "note", "tip", "warning" */ |
| 176 | + |
| 177 | +sdoc-autogen .admonition { |
| 178 | + display: block; |
| 179 | + overflow: hidden; |
| 180 | + padding: 0 var(--autogen-v-rhythm); |
| 181 | + border: var(--requirement-border-width, 1px) solid; |
| 182 | + border-radius: var(--requirement-border-radius); |
| 183 | + margin: var(--autogen-v-rhythm) 0; |
| 184 | + color: var(--color-fg-main); |
| 185 | +} |
| 186 | + |
| 187 | +sdoc-autogen .admonition .admonition-title { |
| 188 | + margin: 0; |
| 189 | + padding-top: calc(0.5 * var(--base-rhythm)); |
| 190 | + padding-bottom: calc(0.5 * var(--base-rhythm)); |
| 191 | + color: currentColor; |
| 192 | + font-weight: 600; |
| 193 | + position: relative; |
| 194 | +} |
| 195 | + |
| 196 | +sdoc-autogen .admonition .admonition-title::after { |
| 197 | + content: ''; |
| 198 | + position: absolute; |
| 199 | + top: 0; bottom: 0; |
| 200 | + left: calc(-1 * var(--autogen-v-rhythm)); |
| 201 | + right: calc(-1 * var(--autogen-v-rhythm)); |
| 202 | + /* background:repeating-linear-gradient( |
| 203 | + -45deg, |
| 204 | + rgba(255, 255, 255, .25), |
| 205 | + rgba(255, 255, 255, .25) 10px, |
| 206 | + rgba(255, 255, 255, .0) 10px, |
| 207 | + rgba(255, 255, 255, .0) 20px |
| 208 | + ); */ |
| 209 | + background-color: currentColor; |
| 210 | + opacity: 0.1; |
| 211 | +} |
| 212 | + |
| 213 | +sdoc-autogen .admonition > *:not(.admonition-title) { |
| 214 | + color: var(--color-fg-main); |
| 215 | +} |
| 216 | + |
| 217 | +sdoc-autogen .admonition.attention { |
| 218 | + color: Crimson; |
| 219 | +} |
| 220 | + |
| 221 | +sdoc-autogen .admonition.caution { |
| 222 | + color: Crimson; |
| 223 | +} |
| 224 | + |
| 225 | +sdoc-autogen .admonition.important { |
| 226 | + color: OrangeRed; |
| 227 | +} |
| 228 | + |
| 229 | +sdoc-autogen .admonition.danger { |
| 230 | + color: red; |
| 231 | +} |
| 232 | + |
| 233 | +sdoc-autogen .admonition.error { |
| 234 | + color: Red; |
| 235 | +} |
| 236 | + |
| 237 | +sdoc-autogen .admonition.warning { |
| 238 | + color: DarkOrange; |
| 239 | +} |
| 240 | + |
| 241 | +sdoc-autogen .admonition.warning .admonition-title::before { |
| 242 | + /* content: '⚠️'; */ |
| 243 | + margin-right: var(--base-rhythm); |
| 244 | +} |
| 245 | + |
| 246 | +sdoc-autogen .admonition.note { |
| 247 | + /* color: CornflowerBlue; */ |
| 248 | + color: SteelBlue; |
| 249 | +} |
| 250 | + |
| 251 | +sdoc-autogen .admonition.hint { |
| 252 | + color: DarkSlateBlue; |
| 253 | +} |
| 254 | + |
| 255 | +sdoc-autogen .admonition.tip { |
| 256 | + color: MediumSlateBlue; |
| 257 | +} |
0 commit comments