Skip to content

Instantly share code, notes, and snippets.

@carloscheddar
Created October 20, 2020 21:43
Show Gist options
  • Save carloscheddar/179b069c7522a915e0e7f43016e71cd8 to your computer and use it in GitHub Desktop.
Save carloscheddar/179b069c7522a915e0e7f43016e71cd8 to your computer and use it in GitHub Desktop.
Hides the Zeplin sidebar that opens by default and requires mouse drag to close
// ==UserScript==
// @name Hide Zeplin Sidebar
// @namespace https://app.zeplin.io/
// @version 0.1
// @description Hides the Zeplin sidebar that opens by default and requires mouse drag to close
// @author Carlos Feliciano-Barba
// @match https://app.zeplin.io/project/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
(new MutationObserver(check)).observe(document, {childList: true, subtree: true});
function check(changes, observer) {
// Disconnect the observer once the elements are rendered
if(document.querySelector('.sidebar .tabContent')) {
observer.disconnect();
var sidebar = document.querySelector('.sidebar');
sidebar.classList.add("collapsed");
sidebar.style.minWidth = "10px";
}
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment