Skip to content

Instantly share code, notes, and snippets.

View adam-kosseck's full-sized avatar

Tyderian adam-kosseck

  • Australia
View GitHub Profile
@chall8908
chall8908 / dark-mode-toggle.js
Last active September 17, 2021 07:37
Rocket.Chat Dark Mode
// Toggleable dark mode for those of us that care about that kind of thing.
const toggleButton = '<button class="sidebar__toolbar-button rc-tooltip rc-tooltip--down js-button" aria-label="Toggle Dark Mode">D</button>';
function addDarkModeToggle() {
const sidebarToolbar = $('.sidebar__toolbar');
// wait for the sidebar toolbar to be visible
// this will also be false if the toolbar doesn't exist yet
if(!sidebarToolbar.is(':visible')) {
setTimeout(addDarkModeToggle, 250);