Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sets a dark mode for slack. Run once after each update without slack running.
$darkString = @'
document.addEventListener('DOMContentLoaded', function() {
$.ajax({
url: 'https://cdn.jsdelivr.net/gh/laCour/slack-night-mode/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; }
.p-threads_footer__input .p-message_input_field { background: #000 }
`
$("<style></style>").appendTo('head').html(css + overrides);
}
});
});
'@
$slackVerDir = (Get-ChildItem -Path $env:LOCALAPPDATA\slack\app-* -Name -Directory | Select-Object -Last 1)
$darkString | Out-File -Append -Encoding "UTF8" $env:LOCALAPPDATA\slack\$slackVerDir\resources\app.asar.unpacked\src\static\ssb-interop.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.