Last active
June 24, 2017 19:12
-
-
Save einarmagnus/d741e30ad13b051d7971 to your computer and use it in GitHub Desktop.
When applying a dark theme to your gtk-system, Fx will use it to render form elements. This gets ugly in webpages and too often a page specifies a dark color for input elelments w/o specifying a light color for the background which makes the text invisible. This fixes those issues by always inserting default colors for form elements.
This file contains hidden or 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 bright forms | |
// @namespace einar | |
// @description Make all form elements default to light style to combat gtk theme | |
// @include * | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
function addDefaultCssRules(rule) { | |
var styleElement = document.createElement('style'); | |
styleElement.type = 'text/css'; | |
document.head.insertBefore(styleElement, document.head.firstChild); | |
styleElement.sheet.insertRule(rule, 0); | |
} | |
addDefaultCssRules('input, button, textarea, select { background-color:#fff;border-radius:5px;color:#111 }'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment