Suitable for the old Discord Layout (before 2025/03/25). Don't use this if you have the new layout.
Discord Minimize Sidebars (Old) by xiaopanpankevinpan
Details
Authorxiaopanpankevinpan
LicenseNo License
Categorydiscord
Created
Updated
Code size3.3 kB
Code checksum42ce74ef
Statistics
Learn how we calculate statistics in the FAQ.
Failed to fetch stats.
Description
Notes
This is suitable for the old Discord layout (before the update of 2025/03/25). It is provided for those who found a way to keep the old layout. If you need the functionality with the new Discord UI, go here.
I stole the idea from the masterpiece https://userstyles.org/styles/227553/ of Vinter (1363485 on userstyles.org).
Source code
/* ==UserStyle==
@name Discord Minimize Sidebars (Old)
@namespace https://openuserjs.org/users/kevin_pan_940506
@version 1.3.2
@description `
I stole the idea from the masterpiece https://userstyles.org/styles/227553/ of Vinter (1363485 on userstyles.org). But what's different?
- Use Sidebar as Triggerzone; vice versa if possible and you want.
- Choose what to be minimized.
2024-12-19 About the "`!important` fix": Someone wrote `!impotant` in the css files of Discord and thus freezed the width of the Channel sidebar (which is not a good practice when writing CSS). To revert the issue, I have to use `!important`, too 🥲. I made it a switch so you can close it whenever possible (or when you need to).
`
@author XiaoPanPanKevinPan
@preprocessor uso
var <type> <name> <label> <default value>
@var text duration "Transition Duration" 0.25s
@var text delay "Transition Delay (e.g. before re-minimizing)" 0.75s
@var select cWork "Channels - Minimize?" {
"Yes*": "",
"No": "*:not(*)"
}
@var select cSelSvrBar "Channels - Server Sidebar as Triggerzone" {
"Yes*": `[class*="guilds"]:not(:hover):not(:focus-within) + * `,
"No": `[class*="guilds"] + *`
}
@var text cOpa "Channels - Opacity on minimized" 0.00
@var text cVisWidth "Channels - Visible Width on minimized" 5px
@var select importantFix "Channels - Use the !important fix? (Switch to \"no\" if possible)" {
"Yes*": "!important",
"No": ""
}
------
@var select gWork "Servers - Minimize?" {
"Yes*": "",
"No": "*:not(*)"
}
@var text gVisWidth "Servers - Visible Width on minimized" 5px
@var text gOpa "Servers - Opacity on minimized" 0.00
@var select gSelChlBar "Servers - Channel Sidebar as Triggerzone" {
"Yes*": `:not(:has(+ * [class*="sidebar_"]:is(:hover, :focus-within)))`,
"No": ""
}
==/UserStyle== */
@-moz-document regexp("https?://(ptb\\.|canary\\.)?discord.com/(channels|store|guild-discovery).*") {
/*-- START OF channel sidebar --*/
/*[[cWork]]*/ [class*="sidebar_"] {
transition: width /*[[duration]]*/, opacity /*[[duration]]*/;
opacity: 1;
}
/*[[cWork]]*/ /*[[cSelSvrBar]]*/ [class*="sidebar_"]:not(:hover):not(:focus-within) {
transition: width /*[[duration]]*/ /*[[delay]]*/, opacity /*[[duration]]*/ /*[[delay]]*/;
width: /*[[cVisWidth]]*/ /*[[importantFix]]*/;
opacity: /*[[cOpa]]*/;
}
/*-- END OF channel sidebar --*/
/*-- START OF guild sidebar --*/
/*[[gWork]]*/ [class*="guilds_"]{
transition: width /*[[duration]]*/, opacity /*[[duration]]*/;
opacity: 1;
}
/*[[gWork]]*/ [class*="guilds_"]:not(:hover):not(:focus-within)/*[[gSelChlBar]]*/ {
transition: width /*[[duration]]*/ /*[[delay]]*/, opacity /*[[duration]]*/ /*[[delay]]*/;
width: /*[[gVisWidth]]*/;
opacity: /*[[gOpa]]*/;
}
/*-- END OF guild sidebar --*/
}