re: Easy Dark Mode for Slack VIEW POST

TOP OF THREAD FULL DISCUSSION
re: I apologize if this is a trivial question since I know essentially no JS, but how would you modify the added js above in order to read the .css fro...
 

This will work for you. Again, put it at the end of the ssb-interop.js file. If you are running on Windows, use the forward slash and start the path with 'C:/' :

document.addEventListener('DOMContentLoaded', function() {
var fs = require('fs'),
filePath = '/Applications/Slack.app/Contents/Resources/black-slack.css';

fs.readFile(filePath, {encoding: 'utf-8'}, function(err, data) {
if (!err) {
var css = document.createElement('style')
css.innerText = data;
document.getElementsByTagName('head')[0].appendChild(css);
}
})
});

code of conduct - report abuse