(revised)
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
- From the slack main menu: view/developer/toggle webapp Devtools
- Right click any element in the app (except the team switcher on the left), and choose Inspect Element
- use this to build up your custom element styles
- When you are done, shut down Slack
This persists across restarts/reloads (but probably not across app updates):
1. Find Slack.app (usually in /Applications folder)
2. Right click and select “Show Package Contents”
3. Navigate to Contents/Resources/app.asar.unpacked/src/static
4. Open ssb-interop.js for editing
Add this code (below) to the bottom of the file:
document.addEventListener('DOMContentLoaded', function() {
let tt__customCss = `
// custom inline css goes here...open the dev tools as described above...
// from the slack menu: view/developer/toggle webapp Devtools
// the interface is just like a browser....just select the elements you want and make up your styles
// then place them below here this line
`;
$.ajax({
url: 'https://gist.githubusercontent.com/thefonso/8ba7f36a14e7be4c4568f8520f0cd4c0/raw/ac87b397e0b6f080ef306d151518d66f90d0bb14/slack-dark-theme.css',
success: function(css) {
$('<style></style>').appendTo('head').html(css + tt__customCss);
}
});
});
NOTE: You can create your own larger CSS file as a gist and point to it as I have in the $.ajax section
- at your terminal prompt...
- $ export SLACK_DEVELOPER_MENU=true
- $ open /Applications/Slack.app
This gist is based off of DrewML's older document, outdated at the time of this documents creation, I used the notes found in the comments section to compile this gist.