Last active
December 25, 2020 08:08
-
-
Save isqad/c8c0044b2415143163291666442ae41c to your computer and use it in GitHub Desktop.
Night theme for api.flutter.dev
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Fix flutter.dev Night theme | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Enables night theme for documentation site api.flutter.dev | |
// @author Andrew S | |
// @match https://api.flutter.dev/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// Your code here... | |
window.addEventListener('load', (event) => { | |
const cssFontColor = 'color: #d3d4d4 !important;'; | |
const el = document.querySelector('body'); | |
if (el) { | |
el.style.cssText = 'font-weight: 400 !important; background-color: #031f30; ' + cssFontColor; | |
} | |
const selectors2FixColor = ['dd', 'h1', 'h2', 'h3', 'h4', 'h5']; | |
selectors2FixColor.forEach(function(s) { | |
let els = document.querySelectorAll(s); | |
if (els) { | |
els.forEach(function(el) { | |
el.style.cssText = cssFontColor; | |
}); | |
} | |
}); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment