diff --git a/script.user.js b/script.user.js index 6a44834..c167d3e 100644 --- a/script.user.js +++ b/script.user.js @@ -16,12 +16,14 @@ if (document.querySelectorAll('[data-bs-theme]').length > 0) { // By doing some inspectation I determined a lot of pages use // bootstrap 5, and this is how you make bootstrap go in dark mode document.documentElement.setAttribute('data-bs-theme', 'dark'); + document.documentElement.classList.add("text-white"); // Make the text white with a class, rather than custom CSS. } else { // Dark mode patches for non-bootstrap pages const noBoostrapStyle = document.createElement('style'); noBoostrapStyle.innerHTML = ` body { background: #212529; + color: white; } .notes { background: #2D3142 !important; @@ -29,19 +31,10 @@ if (document.querySelectorAll('[data-bs-theme]').length > 0) { .trapezoid { color: #2D3142; } + .trapezoid-footer { + color: #212529; + } `; document.head.appendChild(noBoostrapStyle); } - -// Apply styles to force body to white -const style = document.createElement('style'); -style.innerHTML = ` - body { - color: white; - } - .trapezoid-footer { - color: #212529; - } -`; -document.head.appendChild(style); -console.info("Loaded DarkSnap.") \ No newline at end of file +document.head.appendChild(style); \ No newline at end of file