From 88e08db57e494c7631af8c7a921a65d0476fe8e8 Mon Sep 17 00:00:00 2001 From: Theis Pieter Hollebeek Date: Fri, 13 Dec 2024 11:03:28 +0100 Subject: [PATCH] prettier web code blocks --- web/public/src/index.ts | 2 ++ web/public/style.css | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/web/public/src/index.ts b/web/public/src/index.ts index adc3500..2a7ce53 100644 --- a/web/public/src/index.ts +++ b/web/public/src/index.ts @@ -271,6 +271,7 @@ async function main() { container.classList.add("code-container"); const lines = createLineElement(codeData); const code = document.createElement("pre"); + code.classList.add("code-source"); code.innerText = codeData; container.append(lines, code); view.replaceChildren(container); @@ -282,6 +283,7 @@ async function main() { tooltip.id = "covers-tooltip"; tooltip.hidden = true; const code = document.createElement("pre"); + code.classList.add("code-source"); loadCodeCoverage( codeData, codeCoverageData, diff --git a/web/public/style.css b/web/public/style.css index 6e76882..19d099d 100644 --- a/web/public/style.css +++ b/web/public/style.css @@ -9,6 +9,7 @@ --black: #211F1C; --black-transparent: #211F1Caa; --white: #ECEBE9; + --white-transparent: #ECEBE9aa; --code-status: var(--white); } @@ -91,12 +92,20 @@ main #cover { #view .code-container { display: flex; font-size: 1rem; - gap: 1ch; } #view .code-lines { - border-right: 1px solid var(--white); - padding-right: 0.5ch; + background-color: rgba(255, 255, 255, 0.1); + color: var(--white-transparent); + border-right: 1px solid currentcolor; + padding: 0.5rem; + border-radius: 0.5rem 0 0 0.5rem; +} + +#view .code-source { + background-color: rgba(255, 255, 255, 0.1); + padding: 0.5rem; + border-radius: 0 0.5rem 0.5rem 0; }