OzBargain Dark Mode Classic

The classic OzBargain Dark Mode from before the February 2025 site changes

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name			OzBargain Dark Mode Classic
// @namespace		http://tampermonkey.net/
// @version			0.8
// @description		The classic OzBargain Dark Mode from before the February 2025 site changes
// @match			https://www.ozbargain.com.au/*
// @icon			https://www.ozbargain.com.au/favicon.ico
// @run-at			document-start
// @grant			GM_addStyle
// @license			MIT
// ==/UserScript==

const css = `
[data-color-scheme="dark"] {
	/* main.css */
	--border-clr: #484848 !important;
	--borderhl-clr: #666 !important;
	--comment-hl-bg: #124 !important;
	--comment-op-bg: #333 !important;
	--comment-user-bg: #422 !important;
	--footer-bg: #080808 !important;
	--footer-fg: #888 !important;
	--input-fg: #ddd !important;
	--input-bg: #222226 !important;
	--input-border: #444 !important;
	--light-bg: #333338 !important;
	--light2-bg: #222226 !important;
	--link-fg: #89e !important;
	--link2-fg: #b0c0f0 !important;
	--linkv-fg: #abf !important;
	--meta-fg: #aaa !important;
	--meta-emphasis-fg: #aaa !important;
	--page-bg: #181818 !important;
	--page-fg: #c8c8c8 !important;
	--pageads-bg: #0000007f !important;
	--titlehl-fg: #f63 !important;
	--tooltip-clr: #666 !important;

	/* Inherited from light mode */
	--menu-fg: #000 !important;
	--navmenu-bg: #333 !important;

	/* live.css */
	--live-ad-bg: #030 !important;
	--live-comp-bg: #331 !important;
	--live-forum-bg: #003 !important;

	/* style.css */
	--menuhl-bg: #663300 !important;
	--shade1-bg: #cd6702 !important;
	--shade2-bg: #f7a859 !important;
	--shade3-bg: #b35a02 !important;
	--extra-birthday-bg: #7e5160 !important;
}

#forum > table th {
	background-color: var(--shade3-bg) !important;
	color: #fff !important;
}

#tooltip-title {
	background-color: var(--tooltip-clr) !important;
	color: #fff !important;
}

#noti-snippet > h3 {
	background-color: var(--shade3-bg) !important;
	color: #fff !important;
}

div.comment-wrap {
  padding-bottom: 10px !important;
}

div.comment ul.links a {
  padding: 2px 5px !important;
}

div.c-vote.inact span.voteup,
div.c-vote.inact span.votedown,
div.c-vote.votedown span.voteup,
div.c-vote.voteup span.votedown {
  background-color: transparent !important;
}

div.c-vote.inact span.voteup:hover,
div.c-vote.inact span.votedown:hover,
div.c-vote.votedown span.voteup:hover,
div.c-vote.voteup span.votedown:hover {
  background-color: var(--border-clr) !important;
}

span.cvb {
  border: var(--border-clr) 1px solid !important;
  padding: 1px !important;
}
`;

//Function to inject style
function injectStyle() {
	if (typeof GM_addStyle === 'function') {
		GM_addStyle(css);
	} else {
		const style = document.createElement('style');
		style.textContent = css;
		document.head.appendChild(style);
	}
}

//If <head> already exists, inject immediately
if (document.head) {
	injectStyle();
} else {
	//Fallback to observe DOM until <head> is available
	const observer = new MutationObserver(() => {
		if (document.head) {
			observer.disconnect();
			injectStyle();
		}
	});
	observer.observe(document.documentElement, { childList: true, subtree: true });
}