Slack desktop app themes
Eventually I came across Slack's deep link URI handler, which handles slack: protocol links. I immediately assumed that it wouldn't be possible to do this, so I looked for other ways in the package's source. It shouldn't be possible to persist a client-side change that's executed only once. If this were run on the containing frame, we'd need to send it to the webview as a string to eval by using executeJavaScript. This is run on the chat's webview, not the containing frame. What I needed to do was strip this constraint from the stylesheet, then inject the CSS. Now, I can't just include the styles in a stylesheet link tag, as Stylish requires some Mozilla-specific domain constraints, so none of the styles would even load. With these developer tools, I could attempt to inject the style into the chat's webview. Slack's desktop application will enable them if the SLACK_DEVELOPER_MENU environment variable is set. As such, I looked for a way to enable the application's developer tools (because Electron uses Chromium). I do have experience with Electron, so being familiar with it helped me know what to look for. This wouldn't be as simple as changing the source. Going into this, I knew this was going to be a bit challenging considering how Slack doesn't open source their desktop application. Electron lets you develop native desktop applications using web technologies. But what about the popular desktop application? Supporting the desktop applicationįor those unaware, Slack uses Electron to package applications. So a solution already exists, for the browser.
Jason, the owner of Userstyles kindly lifted the limit so I could continue. I still needed to expand the style to support larger Slack features (like their post editor). (a Stylish theme repository) has a large 100KB limit for themes, so I was rather shocked when I met that limit.
One issue I ran into was how large the style had grown. Recently, I switched from Slack's primary aubergine color, to a more practical black color which quickly overtook the original in popularity. I've refactored everything I wrote, switching from a single CSS file, branching out to what is now over 50 Sass files.
Since 2014, I've maintained a Stylish style named Slack Night Mode. Although they've stated it's a " future possibility", as well as having been a highly requested feature since 2014, I doubt we'll see something like this for some time. Such a change would require significant refactoring of their enormous stylesheets, all for a minor feature that many people wouldn't care about. It would be impractical for Slack to focus on adding a night mode. Still, bright-white pages like Slack can be annoying to have open on a second monitor when chatting or developing. These applications are a life-changer for developers who find themselves groggy upon waking up after working late.
But, there is still one issue that many people face with Slack: its lack of a night mode/dark theme.īefore going further, I should mention that I'm a huge fan of f.lux and Redshift due to the benefits they offer. It's no longer necessary to have tabs open for each of these services while developing, as any relevant information is sent to Slack. Using integrations helps centralize notifications from services like GitLab, Sentry, DeployBot, Datadog, etc.
#Slack desktop app themes update
Update Jan 22, 2016: Slack has fixed this vulnerability, in under 24 hours! This means the solution in this article about using Slack Night Mode on Slack's desktop applications is no longer viable.Īs with other companies, Slack is a valuable communication tool for us at Hund.