Skip to content

Instantly share code, notes, and snippets.

@raisabelatrix
Last active October 4, 2024 21:29
Show Gist options
  • Save raisabelatrix/857efd2395fdf48378aeaed4b1182603 to your computer and use it in GitHub Desktop.
Save raisabelatrix/857efd2395fdf48378aeaed4b1182603 to your computer and use it in GitHub Desktop.
Keeps the sidebar ribbon out of sight and only shows it upon hover. [Not tested on Obsidian 1.0+]
/*HIDE RIBBON WHEN SIDEBAR IS COLLAPSED*/
.side-dock-ribbon.mod-left.is-collapsed .side-dock-ribbon-action {
opacity: 0;
transition: opacity .3s;
}
.side-dock-ribbon.mod-left.is-collapsed:hover .side-dock-actions:hover .side-dock-ribbon-action,
.side-dock-ribbon.mod-left.is-collapsed:hover .side-dock-settings:hover .side-dock-ribbon-action {
opacity: 1;
}
/*HIDE RIBBON WHEN SIDEBAR IS EXPANDED*/
.side-dock-ribbon.mod-left:not(.is-collapsed) .side-dock-ribbon-action,
.side-dock-ribbon.mod-left:not(.is-collapsed) .workspace-ribbon-collapse-btn svg {
opacity: 0;
}
.side-dock-ribbon.mod-left.is-collapsed .workspace-ribbon-collapse-btn:not(hover) + .side-dock-actions:hover .side-dock-ribbon-action,
.side-dock-ribbon.mod-left:hover:not(.is-collapsed) .side-dock-ribbon-action,
.side-dock-ribbon.mod-left:hover:not(.is-collapsed) .workspace-ribbon-collapse-btn svg {
opacity: 1;
}
.side-dock-ribbon.mod-left:not(.is-collapsed) {
flex: 0 0 5px;
transition: flex .2s;
}
.side-dock-ribbon.mod-left:hover:not(.is-collapsed) {
flex: 0 0 40px;
}
@NotFluffy
Copy link

Just an FIY on version 1.6.7 on Windows :
The "Files" icon is hides behind the "Collapse" icon when the mouse hovers over it. The ribbon appears as intended but cannot access files anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment