Vencord icon indicating copy to clipboard operation
Vencord copied to clipboard

add plugin FixHardcodedColors

Open CodeF53 opened this issue 1 year ago • 0 comments

[Depends on utility functions exposed in #2662]

About Plugin

Discord often hardcodes colors despite having css variables for all it's colors.

For example, --primary-160 is #ebedef, but in the code, they have hardcoded the color hex instead of using the variable:

.defaultLightModeCustomGradient_e77fa3 {
    background: linear-gradient(rgba(0,0,0,0) 20%, #ebedef 100%);
}

This causes issues for theme devs who want to make stuff by directly modifying color variables as they need to manually fix all these problems.

This is very prevalent when using ClientTheme and looking at "channels and roles" Discord_tn6oWjipFv

This plugin addresses this issue by generating css to make the problematic code use color variables instead, for example:

.defaultLightModeCustomGradient_e77fa3 {
    background: linear-gradient(rgba(0,0,0,0) 20%, var(--primary-160) 100%);
}

CodeF53 avatar Jul 03 '24 20:07 CodeF53