Figma scroll fix

https://forum.figma.com/t/horizontal-scroll-on-the-layers-panel/643/54

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Figma scroll fix
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  https://forum.figma.com/t/horizontal-scroll-on-the-layers-panel/643/54
// @author       aolko + https://forum.figma.com/u/Toni_Andric & https://forum.figma.com/u/Gomes_Ivan
// @match        *://www.figma.com/file/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=figma.com
// @grant        GM_addStyle
// ==/UserScript==

(function() {
    'use strict';

    // Old way
    /*
    GM_addStyle(`
    [class*="object_row--indent--"] {
        margin: 0 !important;
        width: 8px;
    }
    `);
    */

    GM_addStyle(`
        [data-testid="layer-row-with-children"],
        [data-testid="layer-row"],
        [class|='scroll_container--innerScrollContainer']:not([class|='object_row--instance--']) {
            /* Make each row take up as much horizontal space as it can. */
            width: 100% !important;
        }
        [class|=pages_panel--objectPanelContent-] {
            /* this is what enables scrolling (if needed) in both directions */
            overflow: auto;
        }
        [class*=js-fullscreen-wheel-event-capture][class*=objects_panel--scrollContainer][class*=objects_panel--scrollContainerWithBorder][class*=scroll_container--clipContainer] {
            /* This overrides the inline styles that get added on sidebar resizing. */
            width: 1000px !important;
            position: relative;
        }
        [class|=object_row--indent-]:not([class|=object_row--indent-]:first-of-type) {
            /* This reduces the indentation of nested layers */
            width: 5px;
        }
    `);
    // Additionally, fix the Layers panel label. Prevent overlaying the main area in certain edge cases
    var header = document.querySelector("[class|=pages_panel--objectPanelContent-] [style*='translate3d(0px, 0px, 0px)']");
    header.style.position = 'absolute';
    header.style.transform = 'translate3d(0px, 0px, 0px);';
})();