From ff146857192ab223fa3b5a8f395ebf08068b8c3d Mon Sep 17 00:00:00 2001 From: ehaines Date: Fri, 20 Dec 2024 06:12:23 -0500 Subject: [PATCH] changed colors on some items for 508 compliance --- .../Modules/CreateReport/scripts/main.js | 22 ++++---- .../Modules/CreateReport/styles/main.css | 53 ++++++++++++++++++- 2 files changed, 61 insertions(+), 14 deletions(-) diff --git a/PowerShell/ScubaGear/Modules/CreateReport/scripts/main.js b/PowerShell/ScubaGear/Modules/CreateReport/scripts/main.js index ac917c360f..f76448216a 100644 --- a/PowerShell/ScubaGear/Modules/CreateReport/scripts/main.js +++ b/PowerShell/ScubaGear/Modules/CreateReport/scripts/main.js @@ -10,35 +10,31 @@ const colorRows = () => { for (let i = 0; i < rows.length; i++) { try { if (rows[i].children[requirementCol].innerHTML.startsWith("[DELETED]")) { - rows[i].style.color = "var(--test-deleted-color)"; - rows[i].style.background = "var(--test-other)"; + rows[i].dataset.state = "deleted"; } else if (rows[i].children[statusCol].innerHTML.startsWith("Bug")){ - rows[i].style.background = "var(--test-bug-color)"; + rows[i].dataset.state = "bug"; } else if (rows[i].children[statusCol].innerHTML === "Fail") { - rows[i].style.background = "var(--test-fail)"; - rows[i].style.color = "var(--test-error-color)"; + rows[i].dataset.state = "fail"; } else if (rows[i].children[statusCol].innerHTML === "Warning") { - rows[i].style.background = "var(--test-warning)"; + rows[i].dataset.state = "warning"; } else if (rows[i].children[statusCol].innerHTML === "Pass") { - rows[i].style.background = "var(--test-pass)"; + rows[i].dataset.state = "pass"; } else if (rows[i].children[statusCol].innerHTML === "Omitted") { - rows[i].style.background = "var(--test-other)"; + rows[i].dataset.state = "omitted"; } else if (rows[i].children[criticalityCol].innerHTML.includes("Not-Implemented")) { - rows[i].style.background = "var(--test-other)"; + rows[i].dataset.state = "notimplemented"; } else if (rows[i].children[criticalityCol].innerHTML.includes("3rd Party")) { - rows[i].style.background = "var(--test-other)"; + rows[i].dataset.state = "thirdparty"; } else if (rows[i].children[statusCol].innerHTML.includes("Error")) { - rows[i].style.background = "var(--test-fail)"; - rows[i].querySelectorAll('td')[statusCol].style.borderColor = "var(--border-color)"; - rows[i].querySelectorAll('td')[statusCol].style.color = "var(--test-error-color)"; + rows[i].dataset.state = "error"; } } catch (error) { diff --git a/PowerShell/ScubaGear/Modules/CreateReport/styles/main.css b/PowerShell/ScubaGear/Modules/CreateReport/styles/main.css index 440af37c49..38db3eed7a 100644 --- a/PowerShell/ScubaGear/Modules/CreateReport/styles/main.css +++ b/PowerShell/ScubaGear/Modules/CreateReport/styles/main.css @@ -12,10 +12,11 @@ --cap-even: #0052882d; --cap-hover: #00528850; --header-color: #005288; - --note-color: #ee4e04; + --note-color: #D34503; --header-bottom: black; --link-color: #85B065; --unvisited-link-color: #00668f; + --fail-link-color: #D7EDF4; --text-color: black; --uuid-color: #424242; --border-color: black; @@ -39,6 +40,7 @@ html[data-theme='dark'] { --header-bottom: rgb(221, 221, 221); --link-color: #85B065; --unvisited-link-color: #E6F598; + --fail-link-color: #E6F598;; --text-color: #bdbdbd; --uuid-color: #999999; --border-color: #7b7b7b; @@ -132,6 +134,51 @@ td { overflow-wrap: break-word; } +tr[data-state="pass"] { + background:var(--test-pass); +} + +tr[data-state="fail"] { + background:var(--test-fail); + color:var(--test-error-color); + td a { + color:var(--fail-link-color); + } +} + +tr[data-state="bug"] { + background:var(--test-bug-color); +} + +tr[data-state="warning"] { + background:var(--test-warning); +} + +tr[data-state="deleted"] { + background:var(--test-other); + color:var(--test-deleted-color); +} + +tr[data-state="omitted"]{ + background:var(--test-other); +} + +tr[data-state="notimplemented"]{ + background:var(--test-other); +} + +tr[data-state="thirdparty"]{ + background:var(--test-other); +} + +tr[data-state="error"]{ + background:var(--test-fail); + td { + border-color:var(--border-color); + color:var(--test-error-color); + } +} + td a { color: var(--header-color); } @@ -173,6 +220,10 @@ img { width: 6.25em; } +a[href="#caps"] { + color: var(--caps-link-color); +} + #caps h2 { margin-top: 3.125em; }