Commit graph

4 commits

Author SHA1 Message Date
Asher Gomez
2cab60f90d
refactor(coverage): cleanup CSS output in explorer (--html) output (#29496) 2025-06-02 10:57:28 +09:00
Christian Svensson
5ddbb36d3f
feat(coverage): add dark-mode to HTML coverage report (#29267)
Some checks are pending
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build wasm32 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
This PR adds `color-scheme: light dark` support for the HTML coverage
report. It uses `light-dark(#fff, #000)` to provide colors for each
color scheme.

- There's been [one other change to `coverage/style.css` file
before](66185e0d1d),
so is it fine to to change this file more or should this file stay close
to Istanbul original code?
- I don't think there's any existing tests for the styles, so I could
not see any easy way to add unit tests for these changes
- IMO these changes work without a theme toggle, but I could try adding
one [with some `<head>`
script](https://github.com/denoland/deno/blob/main/cli/tools/coverage/reporter.rs/#L533)
and a button in the navbar if required to land this PR


## Screenshots

<details>
<summary><strong>Coverage summary</strong></summary>

### Before


![image](https://github.com/user-attachments/assets/0a8a9fa7-e597-4ede-baef-4daeef93d237)

### After


![image](https://github.com/user-attachments/assets/6c76ee19-3df1-460d-b191-941cdb26017b)

</details>

<details>
<summary><strong>File coverage<strong></summary>

### Before


![image](https://github.com/user-attachments/assets/8062280a-4209-4ad3-b931-c4816b30881f)

### After


![image](https://github.com/user-attachments/assets/5fcd7a22-549f-4d93-97ab-071224e45e42)

</details>

Closes #29266
2025-05-12 19:37:03 +02:00
Asher Gomez
66185e0d1d
fix(coverage): improve responsiveness of HTML reporter on small screens (#28993) 2025-04-22 13:23:27 +09:00
Yoshiya Hinosawa
d68d1e2022
feat(coverage): add html reporter (#21495)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-12-08 16:54:52 +09:00