PlainFolderIcon: Fix plugin not working (#3409)

This commit is contained in:
sadan4 2025-05-02 21:30:10 -04:00 committed by GitHub
parent bebf3dd068
commit 59974a162e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 45 additions and 32 deletions

View file

@ -16,28 +16,27 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import "./style.css";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
export default definePlugin({
name: "PlainFolderIcon",
description: "Doesn't show the small guild icons in folders",
description: "Dont show the small guild icons in folders",
authors: [Devs.botato],
patches: [{
find: ".expandedFolderIconWrapper",
replacement: [
// there are two elements, the first one is the plain folder icon
// the second is the four guild preview icons
// always show this one (the plain icons)
{
match: /\(\i\|\|\i\)&&(\(.{0,40}\(\i\.animated)/,
replace: "$1",
},
// and never show this one (the guild preview icons)
{
match: /\(\i\|\|!\i\)&&(\(.{0,40}\(\i\.animated)/,
replace: "false&&$1",
}
]
}]
patches: [
{
find: ".folderPreviewGuildIconError",
replacement: [
{
// Discord always renders both plain and guild icons folders and uses a css transtion to switch between them
match: /(?<=.folderButtonContent]:(!\i))/,
replace: (_, hasFolderButtonContentClass) => `,"vc-plainFolderIcon-plain":${hasFolderButtonContentClass}`
}
]
}
]
});

View file

@ -0,0 +1,10 @@
.vc-plainFolderIcon-plain {
/* Without this, they are a bit laggier */
transition: none !important;
/* Don't show the mini guild icons */
transform: translateZ(0);
/* The new icons are fully transparent. Add a sane default to match the old behavior */
background-color: color-mix(in oklab, var(--custom-folder-color, var(--bg-brand)) 30%, var(--background-surface-higher) 70%);
}