DEV Community

Discussion on: Easy Dark Mode for Slack

Collapse
 
amerritt14 profile image
amerritt14 • Edited

Some of the markup needs to be fixed.
'code' '''preformatted''' and >quote are all black on black backgrounds and you can't see them. I edited the above code to include:

document.addEventListener('DOMContentLoaded', function() {
 $.ajax({
   url: 'https://cdn.rawgit.com/laCour/slack-night-mode/master/css/raw/black.css',
   success: function(css) {
     let overrides = `
     code { background-color: #535353; color: #85c5ff; } /* Change color: to whatever font color you want */
     .c-mrkdwn__pre, .c-mrkdwn__quote { background: #535353 !important; background-color: #535353 !important; }
     `
     $("<style></style>").appendTo('head').html(css + overrides);
   }
 });
});

Edited: fixed a typo in the code snippit.
Edited: found a way to also fix backgrounds for '''preformatted''' and >quote