page view optimize - "sass-lang"

固定定位 TOC(Table Of Contents)

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         page view optimize - "sass-lang"
// @namespace    https://xianghongai.github.io
// @version      0.0.2
// @description  固定定位 TOC(Table Of Contents)
// @author       Nicholas Hsiang
// @icon         https://xinlu.ink/favicon.ico
// @match        http*://sass-lang.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    var css = `
          @media (min-width: 1224px) {
            .complementary.content-secondary {position: fixed; right: 10%; bottom: 10%; width: auto; }
            #toc {position: fixed; right: 18px; bottom: 0; top: 50px; max-width: 266px; width: 266px; padding-left: 10px; padding-right: 10px; }
            #search a.full_list_link { margin-right: 5px; }
            #filecontents {padding-right: 300px; }
            #search {position: fixed; right: 13px; }
            #search_frame {position: fixed; }
          }
        `,
        head = document.head || document.getElementsByTagName('head')[0],
        style = document.createElement('style');

    style.type = 'text/css';

    if (style.styleSheet){
        style.styleSheet.cssText = css;
    } else {
        style.appendChild(document.createTextNode(css));
    }

    head.appendChild(style);
})();