Update script.user.js

This commit is contained in:
Nova Cat 2024-11-30 17:27:20 -08:00
parent ac6216f963
commit 1f7ca0befe

View file

@ -16,12 +16,14 @@ if (document.querySelectorAll('[data-bs-theme]').length > 0) {
// By doing some inspectation I determined a lot of pages use // By doing some inspectation I determined a lot of pages use
// bootstrap 5, and this is how you make bootstrap go in dark mode // bootstrap 5, and this is how you make bootstrap go in dark mode
document.documentElement.setAttribute('data-bs-theme', 'dark'); 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 { } else {
// Dark mode patches for non-bootstrap pages // Dark mode patches for non-bootstrap pages
const noBoostrapStyle = document.createElement('style'); const noBoostrapStyle = document.createElement('style');
noBoostrapStyle.innerHTML = ` noBoostrapStyle.innerHTML = `
body { body {
background: #212529; background: #212529;
color: white;
} }
.notes { .notes {
background: #2D3142 !important; background: #2D3142 !important;
@ -29,19 +31,10 @@ if (document.querySelectorAll('[data-bs-theme]').length > 0) {
.trapezoid { .trapezoid {
color: #2D3142; color: #2D3142;
} }
`;
document.head.appendChild(noBoostrapStyle);
}
// Apply styles to force body to white
const style = document.createElement('style');
style.innerHTML = `
body {
color: white;
}
.trapezoid-footer { .trapezoid-footer {
color: #212529; color: #212529;
} }
`; `;
document.head.appendChild(noBoostrapStyle);
}
document.head.appendChild(style); document.head.appendChild(style);
console.info("Loaded DarkSnap.")