openark / custom-slack-css

A custom CSS for Slack App users
MIT License
22 stars 4 forks source link
css javascript slack

custom-slack-css

A custom CSS for Slack App users

What, why

Slack is a wonderful and productive app. Its visual design is well conceived IOHO. However, we find some design decisions do not match our expectations, and some hinder our productivity. Thus, we chose to customize Slack by overriding its default style.

This repository is created and maintained by individuals who work with Slack and whose work productivity is of high priority. Changes include:

Unfortunately Slack does not support custom CSS and we must rely on a hack.

Dear Slack!

We appreciate your product and use it daily for work. Please consider allowing users to apply custom CSS, even if that means letting users shoot themselves in the foot. Thank you!

How

At this time Slack does not officially support custom CSS injection. The following is a hack, known to work on Slack 2.8.2. There is no guarantee it will work on any other version.

Append the following JavaScript code to the end of your local file:

// The following JavaScript snippet was authored by Jonathan la Cour, https://github.com/lacour
// and released to the public domain under CC0 (https://directory.fsf.org/wiki/License:CC0)
document.addEventListener('DOMContentLoaded', function() {
 $.ajax({
   url: 'https://raw.githubusercontent.com/openark/custom-slack-css/master/custom.css',
   success: function(css) {
     $("<style></style>").appendTo('head').html(css);
   }
 });
});

If you cloned this repository locally, you may:

$ make

What happens on Slack upgrade?

Either:

We will try and maintain this repository through next Slack versions. It is quite possible you will need to run a different flow, and import different files, per version.

Credits

The JavaScript hack was proposed by Jonathan la Cour (@laCour), author of slack-night-mode, in this issue. @laCour released the JavaScript snippet to the public domain under CC0.

Contributions

At this time, potentially temporarily, this repository is not open to public contributions. The reasoning is:

Having said that, let's see how this repo plays.

License

This repository is released under the MIT license.