User:KhaozTopsy/global.js

$(function {   $('.wiki-tools__theme-switch').replaceWith('  ');    $(".wiki-tools__theme-switch.custom").css("cursor", "pointer").click(function { var targetTheme = $("body").hasClass("theme-fandomdesktop-light") ? "dark" : "light";

$.when(           $.get(mw.util.wikiScript("wikia") + "?controller=ThemeApi&method=themeVariables&variant=" + targetTheme + "&cb=" + (new Date.getTime)),            $.get(mw.util.wikiScript("load") + "?modules=ext.fandom.DesignSystem.GlobalNavigation.brand." + targetTheme + ".css%7Cext.fandom.DesignSystem.brand." + targetTheme + ".css&only=styles")       ).done(function(wikiCss, brandCss) {            var combinedCss = wikiCss[0] + brandCss[0];            var $s = $("#theme-swapper")[0] || $(" ").attr("id", "theme-swapper").appendTo("body");            $($s).text(combinedCss);            $("body").removeClass("theme-fandomdesktop-light theme-fandomdesktop-dark").addClass("theme-fandomdesktop-" + targetTheme);        }); }); });