BetterFolders: Fix folder bottom margin in main sidebar (#3352)

This commit is contained in:
sadan4 2025-04-04 20:53:06 -04:00 committed by GitHub
parent 0e7d7541bb
commit d753478097
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -195,6 +195,13 @@ export default definePlugin({
predicate: () => settings.store.showFolderIcon !== FolderIconDisplay.Always,
match: /(?<=\.expandedFolderBackground.+?}\),)(?=\i,)/,
replace: "!$self.shouldShowFolderIconAndBackground(!!arguments[0]?.isBetterFolders,arguments[0]?.betterFoldersExpandedIds)?null:"
},
{
// Discord adds a slight bottom margin of 4px when it's expanded
// Which looks off when there's nothing open in the folder
predicate: () => !settings.store.keepIcons,
match: /(?=className:.{0,50}folderIcon)/,
replace: "style:arguments[0]?.isBetterFolders?{}:{marginBottom:0},"
}
]
},