page view optimize - "sass-lang"

固定定位 TOC(Table Of Contents)

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==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);
})();