From 5bcff3919115e4c243a6794d747febbad406f7a2 Mon Sep 17 00:00:00 2001 From: George Sokianos Date: Tue, 26 Apr 2022 21:38:03 +0100 Subject: [PATCH] Added script for StackOverflow --- stackoverflow.js | 51 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 stackoverflow.js diff --git a/stackoverflow.js b/stackoverflow.js new file mode 100644 index 0000000..292db32 --- /dev/null +++ b/stackoverflow.js @@ -0,0 +1,51 @@ +// StackOverflow CSS fixes +// version 1.0 +// 2022-04-26 +// Copyright (c) 2022 Created by Georgios Sokianos +// Released under the GPL license +// http://www.gnu.org/copyleft/gpl.html +// +// ==UserScript== +// @name StackOverflow CSS fixes +// @namespace none +// @description Fixes css in StackOverflow +// @include https://stackoverflow.com/* +// @version $VER: StackOverflow CSS fixes 1.0 (26.04.2022) +// @url https://ko-fi.com/walkero +// ==/UserScript== + + +var css = ' \ +.s-topbar {z-index: 100; background-color: #eee;} \ +.s-topbar--container {} \ +.s-topbar--container > * {display: inline-block;} \ +.s-topbar--container > ol > li {display: inline-block;} \ +.s-topbar--container > div.s-popover {display: none;} \ +h1 {font-size: 1.4rem;} \ +h1 > a {color: black;} \ +#left-sidebar {width: 20%; display: inline-block; vertical-align: top;} \ +#content {width: 78%; display: inline-block;} \ +#mainbar {width: 76%; vertical-align: top;} \ +#sidebar {width: 20%; vertical-align: top;} \ +#footer {background-color: rgb(35, 38, 41); color: white;} \ +#footer a {font-size: 12px; color: white; padding: 20px 10px;} \ +.site-footer--logo {width: 10%; display: inline-block; vertical-align: top;} \ +.site-footer--copyright {width: 26%; display: inline-block; vertical-align: top;} \ +.site-footer--nav {width: 60%; display: inline-block; vertical-align: top;} \ +.site-footer--nav > div {width: 20%; display: inline-block; vertical-align: top;} \ +#mainbar pre {background-color: rgb(246, 246, 246); padding: 5px; overflow: auto;} \ +'; + +var head = document.head || document.getElementsByTagName('head')[0], + style = document.createElement('style'); + +head.appendChild(style); + +style.type = 'text/css'; +if (style.styleSheet){ + // This is required for IE8 and below. + style.styleSheet.cssText = css; +} else { + style.appendChild(document.createTextNode(css)); +} +