Figma: More Space in Layers Panel

The script enables horizontal scrolling and makes the intents before each layer item way smaller. It does not remove the limits, but it gives you way more space to work. Note that you always have to copy and paste the script for each opened document and when you reopen Figma or reload any document.

Verze ze dne 04. 05. 2023. Zobrazit nejnovější verzi.

// ==UserScript==
// @name         Figma: More Space in Layers Panel
// @namespace    me.kalus.figmamorespace
// @version      0.1
// @description  The script enables horizontal scrolling and makes the intents before each layer item way smaller. It does not remove the limits, but it gives you way more space to work. Note that you always have to copy and paste the script for each opened document and when you reopen Figma or reload any document.
// @author       Michael Kalus
// @match        https://www.figma.com/file/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=figma.com
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    function minimizeSpaceInTree() {
        var elements = document.getElementsByClassName("object_row--indent--aWa0t");
        for (var i = 0; i < elements.length; i++) {
            elements[i].style.width = "4px";
        }
    }

    function enableScrolling() {
        const sidebar_elements = document.querySelectorAll('.objects_panel--rowContainer--Y1-LY');
        sidebar_elements.forEach(element => {
            element.style.overflowX = 'scroll';
            element.style.paddingBottom = '15px';
        });
    }

    minimizeSpaceInTree()
    enableScrolling()

    var targetNode = document.body;
    var config = {
        attributes: true,
        childList: true,
        subtree: true
    };
    var callback = function (mutationsList, observer) {
        for (var mutation of mutationsList) {
            if (mutation.type === 'childList') {
                minimizeSpaceInTree()
                enableScrolling()
            }
        }
    };

    var observer = new MutationObserver(callback);

    observer.observe(targetNode, config);
})();
长期地址
遇到问题?请前往 GitHub 提 Issues。