Skip to content

Instantly share code, notes, and snippets.

@congwenma
Last active April 2, 2018 21:29
Show Gist options
  • Save congwenma/2049b5c37c42671d5700442c4dd1a60a to your computer and use it in GitHub Desktop.
Save congwenma/2049b5c37c42671d5700442c4dd1a60a to your computer and use it in GitHub Desktop.
working slack dark theme
var html_file = require("path").join(process.resourcesPath, "app/index.html");
var html = require("fs").readFileSync(html_file, "utf8");
var link_to_inject = '<link href="https://cdn.rawgit.com/ObserverOfTime/07e862ec7240d995e672818f43513bc7/raw/06c86e69c94935962b07b5302c195f7d6465eacd/desktop-dark.css" rel="stylesheet">';
html = html.replace(link_to_inject, "").replace("</head>", `\n${link_to_inject}</head>`);
require("fs").writeFileSync(html_file, html, "utf8");
location.reload();
// thanks to focus97
// nvim /Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js
document.addEventListener('DOMContentLoaded', function() {
let tt__customCss = `
body, .channel_header, #footer, .channel_title_info, #channel_topic_text { background: rgb(0, 43, 54); }
.c-message__body { color: rgb(153, 174, 177); }
#team_menu, .p-channel_sidebar { background: #023f4e !important; }
.c-presence--active {color: rgb(177, 202, 17) !important;}
nav.p-channel_sidebar .p-channel_sidebar__channel--selected, .p-channel_sidebar__link--selected, .c-message_list__day_divider__label__pill, .p-message_pane .c-message_list.c-virtual_list--scrollbar > .c-scrollbar__hider:before { color: #eee !important; background: rgb(27, 139, 210) !important; }
.c-message_list__day_divider__line { border-top-color: rgb(27, 139, 210) !important}
#msg_input, #primary_file_button { background: rgb(2, 55, 68) !important; }
#msg_form #msg_input { border-color: transparent; }
`;
$.ajax({
url: 'https://cdn.rawgit.com/laCour/slack-night-mode/master/css/raw/black.css',
success: function(css) {
$('<style></style>').appendTo('head').html(css + tt__customCss);
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment