So, you love Slack, but you hate applications with large white backgrounds? Why not use Dark Mode!
Unfortunately, Slack does not have a Dark Mode, although it's on their list of possibilities.
But, don't fret - there is a solution! Because the slack native desktop apps are just wrappers around a web app, we can inject our own CSS to customize the application to our liking.
Prerequisite Your custom CSS needs to be hosted somewhere accessible over HTTP. For a free option, you can use a Gist and use the link to the raw file.
- Open up
Slack.app
, and navigate to any message; - In the message input field, enter
/macgap.app.enabledevelopertools()
, and press enter - Right click any element in the app (except the team switcher on the left), and choose
Inspect Element
- Open the
Console
tab - Run the following snippet of JavaScript in your console, replacing the value of
cssURI
with the URI that points to your custom stylesheet.
// Using ajax rather than a dynamically injected <link>, to account for sites (like gist.github.com) that don't serve
// a content-type for CSS files
var cssURI = 'https://gist.githubusercontent.com/DrewML/f244d6015c9b690b1dc241669b69dde1/raw/3d6351b8767ee5fba1ac86cad9b8cc5cf2ff9fea/slack-theme.css';
$.get(cssURI).then(function(css) {
$('<style />').text(css).appendTo('body')
});
If you know the basics of CSS and browser developer tools, writing a theme should be a breeze. You can either use the Developer Tools exposed in the Slack
application itself, or you can visit https://{myteamhere}.slack.com/messages
and use the browser dev tools of your choosing.
Because you're just injecting styles in the DOM, this means that your changes do not persist when you exit and re-open the application. However, the Developer Tools will remember the last code you executed, so it should be a few keystrokes to open the panel and re-run your injection script.
https://gist.github.com/focus97/21a8b7f130f0afd0b26f0d84f3a02d2b