Quick Links

Slack still doesn't have a dark mode. They have dark themes, but those only let you customize the sidebar colors, leaving the main window white. With the release of system-wide dark modes on macOS Mojave and Windows 10, Slack feels very out of place.

This method is unofficial and involves digging around in the source files for Slack. It's fairly easy to do, but since it will be overwritten every time you update, you will have to do this multiple times.

Downloading a Theme

Since Slack runs on Electron, a framework for developing desktop Node.js apps, you can edit the styles for it like you'd edit the CSS of a website. But the CSS files for Slack are buried in the source, so you'll have to load your own themes.

The most popular true dark mode theme is slack-black-theme by Widget. And since Electron shares code across platforms, this theme will work on Windows and Linux as well. We found there were some issues with the theme on macOS Mojave though, so if it doesn't work then you can try this fork, which says it works on macOS only but may work for Windows users as well.

Patching Slack

This part, you'll have to do again every time Slack updates. On macOS, you can get to Slack's source directory by right-clicking on the app itself and selecting "Show Package Contents". On Windows, you'll find it at 

        ~\AppData\Local\slack\
    

.

Then, navigate a few folders down to

        resources/app.asar.unpacked/src/static/
    

. You're going to want to find the

        ssb-interop.js
    

file, where you'll edit the code. Make sure Slack is closed, open that file in your favorite text editor, and scroll to the bottom:

Copy and paste the following code at the very end of the

        ssb-interop.js
    

file:

// First make sure the wrapper app is loaded
    

document.addEventListener("DOMContentLoaded", function() {

// Then get its webviews

let webviews = document.querySelectorAll(".TeamView webview");

// Fetch our CSS in parallel ahead of time

const cssPath = 'https://cdn.rawgit.com/widget-/slack-black-theme/master/custom.css';

let cssPromise = fetch(cssPath).then(response => response.text());

let customCustomCSS = `

:root {

/* Modify these to change your theme colors: */

--primary: #09F;

--text: #CCC;

--background: #080808;

--background-elevated: #222;

}

`

// Insert a style tag into the wrapper view

cssPromise.then(css => {

let s = document.createElement('style');

s.type = 'text/css';

s.innerHTML = css + customCustomCSS;

document.head.appendChild(s);

});

// Wait for each webview to load

webviews.forEach(webview => {

webview.addEventListener('ipc-message', message => {

if (message.channel == 'didFinishLoading')

// Finally add the CSS into the webview

cssPromise.then(css => {

let script = `

let s = document.createElement('style');

s.type = 'text/css';

s.id = 'slack-custom-css';

s.innerHTML = \`${css + customCustomCSS}\`;

document.head.appendChild(s);

`

webview.executeJavaScript(script);

})

});

});

});

You'll probably want to duplicate this file and save it in a different location, so you don't have to edit the code every time. This way, you can just drag it into the directory to overwrite the newest version:

After you're done, reopen Slack, and after a few seconds the dark mode should kick in. The loading screen will still be white, but the main app window will blend in much better with the rest of your system:

Adding Your Own Themes

If you don't like the look of it, you can edit the CSS with any styles you want. All this code does is load custom styles from https://cdn.rawgit.com/widget-/slack-black-theme/master/custom.css; you can download that file, edit it with your changes, and replace the URL with your own code. Save, relaunch Slack, and your changes will be visible. If you don't know CSS, or just want to make a minor change, there are four color variables defined before loading the CSS, so you can just edit those with your own colors.