|
| 1 | +/* |
| 2 | + * coverage.css — appended to coverage.py's report via `[tool.coverage.html] extra_css`. |
| 3 | + * |
| 4 | + * Goal: make the standalone coverage report look like it belongs in the trimesh |
| 5 | + * Furo docs. We import Furo's compiled stylesheet (one dir up on the deployed |
| 6 | + * site) purely to pull in its CSS variables, font stacks and automatic light/dark |
| 7 | + * — Furo switches on `@media (prefers-color-scheme:dark){body:not([data-theme=light])}` |
| 8 | + * and coverage's <body> has no `data-theme`, so it follows the OS like the docs do. |
| 9 | + * |
| 10 | + * Colors reference Furo variables only — no hardcoded hex — so light/dark stays |
| 11 | + * in sync with the docs; the one media query below is layout-only (responsive). |
| 12 | + */ |
| 13 | + |
| 14 | +@import "../_static/styles/furo.css"; |
| 15 | + |
| 16 | +body { |
| 17 | + background: var(--color-background-primary); |
| 18 | + color: var(--color-foreground-primary); |
| 19 | + font-family: var(--font-stack); |
| 20 | +} |
| 21 | + |
| 22 | +a, a.nav { |
| 23 | + color: var(--color-link); |
| 24 | +} |
| 25 | + |
| 26 | +/* ---- header ---------------------------------------------------------- */ |
| 27 | +header { |
| 28 | + background: var(--color-background-secondary); |
| 29 | + border-bottom: 1px solid var(--color-background-border); |
| 30 | +} |
| 31 | + |
| 32 | +header h1 { |
| 33 | + font-weight: 600; |
| 34 | +} |
| 35 | + |
| 36 | +.pc_cov { |
| 37 | + color: var(--color-brand-primary); |
| 38 | + font-weight: 700; |
| 39 | +} |
| 40 | + |
| 41 | +header p.text, footer .content { |
| 42 | + color: var(--color-foreground-muted); |
| 43 | +} |
| 44 | + |
| 45 | +/* nav tabs (Files / Functions / Classes) styled like Furo buttons */ |
| 46 | +header h2 a.button { |
| 47 | + background: var(--color-background-secondary); |
| 48 | + border: 1px solid var(--color-background-border); |
| 49 | + border-radius: 0.25em; |
| 50 | + color: var(--color-foreground-secondary); |
| 51 | +} |
| 52 | +header h2 a.button:hover { |
| 53 | + color: var(--color-brand-primary); |
| 54 | + border-color: var(--color-foreground-border); |
| 55 | +} |
| 56 | +header h2 a.button.current { |
| 57 | + background: var(--color-background-primary); |
| 58 | + border-color: var(--color-brand-primary); |
| 59 | + color: var(--color-foreground-primary); |
| 60 | +} |
| 61 | + |
| 62 | +/* show run/mis/exc/par toggle buttons — neutral chrome, coverage keeps its |
| 63 | + * semantic backgrounds when a category is active (.show_*) */ |
| 64 | +header button { |
| 65 | + background: var(--color-background-primary); |
| 66 | + border: 1px solid var(--color-background-border); |
| 67 | + border-radius: 0.25em; |
| 68 | + color: var(--color-foreground-secondary); |
| 69 | +} |
| 70 | + |
| 71 | +/* ---- filter box ------------------------------------------------------ */ |
| 72 | +#filter_container #filter { |
| 73 | + background: var(--color-background-primary); |
| 74 | + border: 1px solid var(--color-background-border); |
| 75 | + border-radius: 0.25em; |
| 76 | + color: var(--color-foreground-primary); |
| 77 | +} |
| 78 | +#filter_container #filter:focus { |
| 79 | + border-color: var(--color-brand-primary); |
| 80 | +} |
| 81 | +#filter_container label { |
| 82 | + color: var(--color-foreground-muted); |
| 83 | +} |
| 84 | + |
| 85 | +/* keyboard-shortcut key caps */ |
| 86 | +kbd { |
| 87 | + background: var(--color-inline-code-background); |
| 88 | + border: 1px solid var(--color-background-border); |
| 89 | + border-radius: 0.25em; |
| 90 | + color: var(--color-foreground-primary); |
| 91 | + font-family: var(--font-stack--monospace); |
| 92 | +} |
| 93 | + |
| 94 | +#help_panel { |
| 95 | + background: var(--color-background-secondary); |
| 96 | + border: 1px solid var(--color-background-border); |
| 97 | + color: var(--color-foreground-primary); |
| 98 | +} |
| 99 | + |
| 100 | +/* ---- index table ----------------------------------------------------- */ |
| 101 | +#index { |
| 102 | + font-family: var(--font-stack--monospace); |
| 103 | +} |
| 104 | + |
| 105 | +/* numeric columns: right aligned, tabular figures so digits line up and each |
| 106 | + * header sits squarely over its column */ |
| 107 | +#index td, #index th { |
| 108 | + border-bottom: 1px solid var(--color-background-border); |
| 109 | + text-align: right; |
| 110 | + font-variant-numeric: tabular-nums; |
| 111 | +} |
| 112 | +#index td.name, #index th.name { |
| 113 | + text-align: left; |
| 114 | + font-family: var(--font-stack); |
| 115 | +} |
| 116 | + |
| 117 | +#index th { |
| 118 | + color: var(--color-foreground-secondary); |
| 119 | + border-color: var(--color-background-border); |
| 120 | +} |
| 121 | +#index th:hover, |
| 122 | +#index th[aria-sort="ascending"], |
| 123 | +#index th[aria-sort="descending"] { |
| 124 | + background: var(--color-background-hover); |
| 125 | +} |
| 126 | +#index th .arrows { |
| 127 | + color: var(--color-foreground-muted); |
| 128 | +} |
| 129 | + |
| 130 | +#index td.name a { |
| 131 | + color: inherit; |
| 132 | +} |
| 133 | +#index tr.region:hover { |
| 134 | + background: var(--color-background-hover); |
| 135 | +} |
| 136 | +#index tr.region:hover td.name { |
| 137 | + color: var(--color-brand-primary); |
| 138 | +} |
| 139 | +#index tr.total td { |
| 140 | + border-top: 1px solid var(--color-foreground-border); |
| 141 | +} |
| 142 | + |
| 143 | +/* ---- source view ----------------------------------------------------- */ |
| 144 | +#source { |
| 145 | + font-family: var(--font-stack--monospace); |
| 146 | +} |
| 147 | +/* Furo's bare `p{margin}` would gap every code line — id specificity wins */ |
| 148 | +#source p { |
| 149 | + margin: 0; |
| 150 | +} |
| 151 | +#source p .n, #source p .n a { |
| 152 | + color: var(--color-foreground-muted); |
| 153 | +} |
| 154 | +#source p .t .key { |
| 155 | + color: var(--color-brand-primary); |
| 156 | +} |
| 157 | +#source p .t .com { |
| 158 | + color: var(--color-foreground-muted); |
| 159 | +} |
| 160 | + |
| 161 | +#scroll_marker { |
| 162 | + background: var(--color-background-primary); |
| 163 | + border-left: 1px solid var(--color-background-border); |
| 164 | +} |
| 165 | +#scroll_marker .marker { |
| 166 | + background: var(--color-background-border); |
| 167 | +} |
| 168 | + |
| 169 | +/* ---- layout: centered Furo-style column, responsive ------------------ */ |
| 170 | +/* coverage hard-codes a 3.5rem left margin and floats the filter, so the |
| 171 | + * stock page is left-jammed and desktop-only. center a max-width column, |
| 172 | + * make the table fill it (so the title block and table share a width and |
| 173 | + * left edge), and collapse to a usable table on phones. */ |
| 174 | +:root { |
| 175 | + --cov-width: 52rem; |
| 176 | + --cov-pad: 2rem; |
| 177 | +} |
| 178 | + |
| 179 | +header .content, |
| 180 | +main#index, |
| 181 | +main#source, |
| 182 | +footer .content { |
| 183 | + max-width: var(--cov-width); |
| 184 | + margin-left: auto; |
| 185 | + margin-right: auto; |
| 186 | + box-sizing: border-box; |
| 187 | +} |
| 188 | + |
| 189 | +header .content { padding-left: var(--cov-pad); padding-right: var(--cov-pad); } |
| 190 | +main#index { margin-top: 1rem; padding: 0 var(--cov-pad); } |
| 191 | +footer { margin-left: 0; margin-right: 0; } |
| 192 | +footer .content { padding: 0 var(--cov-pad); } |
| 193 | +/* keep room for the floated line-number gutter */ |
| 194 | +main#source { padding-left: calc(var(--cov-pad) + 3.5rem); padding-right: var(--cov-pad); } |
| 195 | + |
| 196 | +/* table fills the column so its width + left edge match the title block */ |
| 197 | +#index table.index { width: 100%; margin: 0; } |
| 198 | + |
| 199 | +@media (max-width: 700px) { |
| 200 | + /* collapse the side margin to the screen edge */ |
| 201 | + :root { --cov-pad: 0.75rem; } |
| 202 | + /* the centering auto-margins leave a stray left offset here — pin flush */ |
| 203 | + header .content, main#index, main#source, footer .content { |
| 204 | + margin-left: 0; |
| 205 | + margin-right: 0; |
| 206 | + } |
| 207 | + /* stack the filter instead of floating it off-screen */ |
| 208 | + #filter_container { float: none; margin: 0.5rem 0 0; } |
| 209 | + #filter_container #filter { width: 100%; box-sizing: border-box; } |
| 210 | + /* a 5-column table can't fit a phone — drop the low-value columns and |
| 211 | + * keep File / missing / coverage% */ |
| 212 | + #index th.spacer, #index td.spacer, |
| 213 | + #index th#statements, #index tr > td:nth-child(3), |
| 214 | + #index th#excluded, #index tr > td:nth-child(5) { display: none; } |
| 215 | + #index td.name, #index th.name { min-width: 0; } |
| 216 | +} |
0 commit comments