Community-edition: Allow custom CSS for services (+ time based activation)

Created on 3 Jul 2016  路  8Comments  路  Source: ramboxapp/community-edition

The idea is that I can include nightmode CSS on Slack during certain times. (And other services too)

I can probably code this myself so this issue is mostly for tracking :)

enhancement

Most helpful comment

Hi! quick way to implement this feature...
I added the following JS to the custom code section of the service (and tested it on a few services, with much success)...

function applycss(css){
    var head = document.getElementsByTagName('head')[0];
    var s = document.createElement('style');
    s.setAttribute('type', 'text/css');
    s.appendChild(document.createTextNode(css));
    head.appendChild(s);
 }
//apply via applycss(`YOUR CSS HERE`);

Use the CSS from User Styles. For example, here's a theme for Messenger...

All 8 comments

It will be a great feature!

You are welcome if you can contribute with this task. :wink:

The idea is to add a new option in the configuration window for each service, and the user can enable this feature with predefined CSS files.

Here's a nightmode for Skype.

Hi! quick way to implement this feature...
I added the following JS to the custom code section of the service (and tested it on a few services, with much success)...

function applycss(css){
    var head = document.getElementsByTagName('head')[0];
    var s = document.createElement('style');
    s.setAttribute('type', 'text/css');
    s.appendChild(document.createTextNode(css));
    head.appendChild(s);
 }
//apply via applycss(`YOUR CSS HERE`);

Use the CSS from User Styles. For example, here's a theme for Messenger...

@skmexyz I can't get this to work, do I just paste the entire CSS code between the `` or do I save it as a .css file and put the path to it?

@Silent-Hunter

  1. go to custom code section for the particular service

  2. first add the above function

  3. then on the next line, add the following line (replace YOUR_CSS_HERE with your actual css)

applycss(`YOUR_CSS_HERE`)

Hope that helps!

It did yes thank you!

Skype dark theme broken as of posting date. :/

Can anyone get this snippet working with Slack?

Edit: Nevermind! For those that need things spelled out like I did: //apply via applycss( is a comment and needs to be uncommented first (and "apply via " deleted). It works!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

juanmlambre picture juanmlambre  路  3Comments

SimJoSt picture SimJoSt  路  4Comments

andrii-riabchun picture andrii-riabchun  路  3Comments

jamy015 picture jamy015  路  4Comments

igalic picture igalic  路  3Comments