Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Userscript for making Discord sidebar in Light theme dark again, after September 2019 update.
// ==UserScript==
// @name Discord dark sidebar for Light theme
// @namespace Violentmonkey Scripts
// @match https://discordapp.com/*
// @grant none
// ==/UserScript==
var style = `
/*
Invert but keep hue on server lists (guilds) and sidebar.
- invert(100%): invert colors
- hue-rotate(180deg): restore the original hue of the inverted colors
*/
[class*="guilds-"],
[class*="sidebar-"] {
filter: invert(100%) hue-rotate(180deg);
}
/*
Try to restore original colors of server icons and user avatars.
Not perfect, looks like color vibrance is a bit lost somehow, but better than nothing.
*/
[class*="guilds-"] [class*="blobContainer-"] img,
[class*="sidebar-"] [class*="avatar-"] img {
filter: invert(100%) hue-rotate(180deg);
}
`;
ready = (fn) => {
if (document.attachEvent ? document.readyState === "complete" : document.readyState !== "loading"){
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
}
}
var run = () => {
((cssString) => {
var style = document.createElement('style');
style.innerHTML = cssString;
document.getElementsByTagName('head')[0].appendChild(style);
})(style);
};
ready(run);
run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.