prettier web code blocks

This commit is contained in:
Theis Pieter Hollebeek 2024-12-13 11:03:28 +01:00
parent 275be8f29f
commit 88e08db57e
2 changed files with 14 additions and 3 deletions

View File

@ -271,6 +271,7 @@ async function main() {
container.classList.add("code-container"); container.classList.add("code-container");
const lines = createLineElement(codeData); const lines = createLineElement(codeData);
const code = document.createElement("pre"); const code = document.createElement("pre");
code.classList.add("code-source");
code.innerText = codeData; code.innerText = codeData;
container.append(lines, code); container.append(lines, code);
view.replaceChildren(container); view.replaceChildren(container);
@ -282,6 +283,7 @@ async function main() {
tooltip.id = "covers-tooltip"; tooltip.id = "covers-tooltip";
tooltip.hidden = true; tooltip.hidden = true;
const code = document.createElement("pre"); const code = document.createElement("pre");
code.classList.add("code-source");
loadCodeCoverage( loadCodeCoverage(
codeData, codeData,
codeCoverageData, codeCoverageData,

View File

@ -9,6 +9,7 @@
--black: #211F1C; --black: #211F1C;
--black-transparent: #211F1Caa; --black-transparent: #211F1Caa;
--white: #ECEBE9; --white: #ECEBE9;
--white-transparent: #ECEBE9aa;
--code-status: var(--white); --code-status: var(--white);
} }
@ -91,12 +92,20 @@ main #cover {
#view .code-container { #view .code-container {
display: flex; display: flex;
font-size: 1rem; font-size: 1rem;
gap: 1ch;
} }
#view .code-lines { #view .code-lines {
border-right: 1px solid var(--white); background-color: rgba(255, 255, 255, 0.1);
padding-right: 0.5ch; 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;
} }