Update script.user.js
This commit is contained in:
parent
ac6216f963
commit
1f7ca0befe
1 changed files with 6 additions and 13 deletions
|
@ -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.")
|
Loading…
Reference in a new issue