Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add plugin FixHardcodedColors #2663

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

CodeF53
Copy link
Contributor

@CodeF53 CodeF53 commented Jul 3, 2024

[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 CodeF53 changed the title add plugin FixHardcodedColors [DRAFT] add plugin FixHardcodedColors Jul 3, 2024
@CodeF53 CodeF53 changed the base branch from main to dev July 3, 2024 20:58
prefer --primary variables
use simpler hsl => rgb conversion
@CodeF53 CodeF53 changed the title [DRAFT] add plugin FixHardcodedColors add plugin FixHardcodedColors Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant