Skip to content

Commit fd1a1f7

Browse files
committed
Add collapse server folders snippet
1 parent b762816 commit fd1a1f7

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ Script used for generating the css: [https://gist.github.com/Davr1/42e64ec0b2ae4
3535

3636
---
3737

38+
### [Collapse server folders](/snippets/collapse_server_folders.css)
39+
Automatically collapses server folders until you hover over them\
40+
41+
![](https://cdn.discordapp.com/attachments/692065688524816475/972155005824036865/folders.gif)
42+
43+
---
44+
3845
### [Collapse threads](/snippets/collapse_threads.css?raw=true)
3946

4047
![](https://cdn.discordapp.com/attachments/692065688524816475/909112685344481373/unknown.png)

snippets/collapse_server_folders.css

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
.wrapper-38slSD:not(:hover)>ul {
2+
display: grid;
3+
height: 48px !important;
4+
width: 48px;
5+
padding: 6px;
6+
grid-template: 1fr 1fr/1fr 1fr;
7+
position: absolute;
8+
top: 0;
9+
left: 12px;
10+
box-sizing: border-box;
11+
pointer-events: none;
12+
gap: 4px;
13+
justify-content: center;
14+
align-items: center;
15+
animation: shrinkingAnimation 100ms ease-in;
16+
}
17+
.wrapper-38slSD>ul {
18+
transition: height 150ms ease-out;
19+
}
20+
@keyframes shrinkingAnimation { from { position: relative; } }
21+
.wrapper-38slSD:not(:hover) .expandedFolderIconWrapper-3RwQpD>svg {
22+
width: 100%;
23+
height: 100%;
24+
background: currentColor;
25+
opacity: 0.4;
26+
}
27+
.wrapper-38slSD:not(:hover)>.expandedFolderBackground-1kSAf6:not(.collapsed-uGXEbi), .wrapper-38slSD:not(:hover)>.expandedFolderBackground-1kSAf6:not(.collapsed-uGXEbi)~* :is(ul>.listItem-3SmSlK:nth-of-type(4)~*, .upperBadge-1V6Iyi) {
28+
visibility: hidden;
29+
}
30+
.wrapper-38slSD:not(:hover)>ul :is(.wrapper-28eC3z, .svg-2zuE5p, .listItem-3SmSlK) {
31+
position: static;
32+
width: 16px;
33+
height: 16px;
34+
margin: 0;
35+
}
36+
.wrapper-38slSD:not(:hover)>ul>.listItem-3SmSlK .pill-2RsI5Q {
37+
left: -12px;
38+
visibility: visible;
39+
}
40+
.wrapper-38slSD:not(:hover)>ul>.listItem-3SmSlK .svg-2zuE5p>foreignObject {
41+
mask: none;
42+
border-radius: 50%;
43+
}
44+
.wrapper-38slSD:not(:hover)>.expandedFolderBackground-1kSAf6:not(.collapsed-uGXEbi)~* .lowerBadge-3WTshO>.numberBadge-37OJ3S {
45+
max-width: 16px;
46+
color: transparent;
47+
background: radial-gradient(white 30%, transparent 30%);
48+
outline: 4px solid var(--background-tertiary);
49+
}

0 commit comments

Comments
 (0)