Skip to content

Instantly share code, notes, and snippets.

@bluebear94
Created September 28, 2017 14:32
Show Gist options
  • Save bluebear94/6433301018c02f1d2baae744336026c1 to your computer and use it in GitHub Desktop.
Save bluebear94/6433301018c02f1d2baae744336026c1 to your computer and use it in GitHub Desktop.
Paste into Discord console to dynamically change CSS
var rules = document.styleSheets[0].rules;
var subs = {
'Whitney, "Helvetica Neue", Helvetica, Arial, sans-serif':
'"VL PGothic", sans-serif'
};
for (var i = 0; i < rules.length; ++i) {
var r = rules[i];
var cssText = r.cssText;
var sd = r.style;
if (!sd) continue;
var oldff = sd.fontFamily;
var newff = subs[oldff];
if (newff) {
sd.fontFamily = newff;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment