Skip to content

Instantly share code, notes, and snippets.

@biaocy
Created August 22, 2023 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save biaocy/e80b83af1c13c9f6bd712efb759822ed to your computer and use it in GitHub Desktop.
Save biaocy/e80b83af1c13c9f6bd712efb759822ed to your computer and use it in GitHub Desktop.
Replace twitter ugly font in Chinese
// ==UserScript==
// @name Twitter font beauty
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Replace twitter ugly font in Chinese!
// @author Bill Chan
// @match https://twitter.com/*
// @icon
// @grant none
// ==/UserScript==
(function() {
'use strict';
var rule = `div[data-testid="tweetText"] > span {
font-family: system-ui !important;
}`;
var styleElement = document.createElement("style");
styleElement.type = "text/css";
if (styleElement.style.cssText) {
styleElement.style.cssText = rule;
} else {
styleElement.appendChild(document.createTextNode(rule));
}
document.getElementsByTagName("head")[0].appendChild(styleElement);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment