Greasy Fork

来自缓存

Greasy Fork is available in English.

GitHub night mode with reversed colors

Blindlingly white backgrounds at night? No problem, tiny and futureproof.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        GitHub night mode with reversed colors
// @description Blindlingly white backgrounds at night? No problem, tiny and futureproof.
// @namespace   http://greasyfork.icu/users/4813-swyter
// @match       *://github.com/*
// @version     3
// @grant       GM_addStyle
// @run-at      document-start
// ==/UserScript==

GM_addStyle
(`
  html
  {
    background-color: white;
    color: black;
    filter: contrast(110%) invert(85%) hue-rotate(90deg);
  }

  img
  {
    filter: invert(125%) hue-rotate(-90deg);
  }

  /* swy: the header is now dark; so more hacks */

  div.header[role=banner]
  {
    filter: invert(85%);
    z-index: 40000;
  }

  div.header[role=banner] img
  {
    filter: hue-rotate(265deg);
  }

  div.header[role=banner] div.dropdown-menu
  {
    filter: invert(85%);
  }
`)

/* swy: fix the weird left cutoff edge in the original page's logo */
document.addEventListener('DOMContentLoaded', function()
{
  if ((logo = document.querySelector("a.header-logo-invertocat svg.octicon-mark-github")))
    logo.viewBox.baseVal.height = 17; /* swy: was 16 */
});