This is what you get after following these simple instructions This is what you get after following these simple instructions

July 2019 update 😭

The Slack version 4.0.0 is not compatible with this solution. Need to investigate and if we can do this in this version as well.

June 2019 update 💁‍

  • Added a bonus step at the end of the post, for automating the dark theme implementation with a simple double-click. 😁
  • Dark mode has arrived for mobile apps. Read it in the Slack blog itself. Desktop dark mode still in progress. Hopefully we can use this little hack here.
  • Uddated the rawgit.com links to jsdelivr.com. (Thanks Israel Tiomno 🤗)

Credits to this Gist.

First, configure the general theme 👨‍💻

  1. Close Slack
  2. Open this file /Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js
  3. Append this at the very bottom
document.addEventListener("DOMContentLoaded", function() {
  let tt__customCss =
    ".menu ul li a:not(.inline_menu_link) {color: #fff !important;}";
  $.ajax({
    url:
      "https://cdn.jsdelivr.net/gh/laCour/slack-night-mode@master/css/raw/black.css",
    success: function(css) {
      $("<style></style>")
        .appendTo("head")
        .html(css + tt__customCss);
    }
  });
});

Second, choose a proper sidebar theme 💅

  1. Go to Preferences / Sidebar
  2. At the end of that page, choose to set a custom color
  3. Paste this custom theme:
#171717,#404245,#424242,#ECF0F1,#4A4A4A,#FAFAFA,#2ECC71,#00A362

You can see other sidebar themes at Slack Theme. The one I chose is Green Lantern.

Enjoy the darkness 😈

That’s it. You can now open Slack and see the results!

¡Bonus step! Automatize this 🤓

Every time Slack makes a little update, you’ll need to manually add that little script again and again.

Well, not anymore.

First, create a bash script with the following content.

#/bin/sh

FILE=/Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js
CSS_SOURCE=https://cdn.jsdelivr.net/gh/laCour/slack-night-mode@master/css/raw/black.css

cat >>$FILE <<EOL

document.addEventListener('DOMContentLoaded', function() {
    let tt__customCss = '.menu ul li a:not(.inline_menu_link) {color: #fff !important;}'
    $.ajax({
        url: '$CSS_SOURCE',
        success: function(css) {
            \$('<style></style>').appendTo('head').html(css + tt__customCss);
        }
   });
});
EOL

Save it to file “slack-apply-dark-theme.sh.command”. The .command extension makes the file double-clickable from the Finder.

Finally, set permissions 700 for it. So you’re the only that can use it.

chmod 700 slack-apply-dark-theme.sh.command

Now, every time you need to apply the dark theme, just double click your brand new file.




Thanks for your time!

I'm nahuelhds. If you like what I do, you can...