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

RoleColorEverywhere: Embed/Time/Pronouns support #3098

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

henmalib
Copy link
Contributor

Before:
image

After:
image

Screenshots are made with 70% saturation.

So turns out my last PR #3036 was kinda broken

When trying to re-assign a css var with itself css can't find it!

--text-muted: var(--text-muted) 

will resolve in a black color because of circular dependency, but because we're using color-mix it just mixed our role color with black :)

That's why i'm doing this weird stuff in css, so we don't have circular dependency and colors will resolve as intended

Why changing patch location?

Previous patch was on a too "deep" level of a message, so it could be applied to a normal text, but text inside of embeds will be ignored.
So i've moved it to a message item itself, where MessageLogger and ThemeAtribbutes also have patches

So with both these changes we have:

  1. headers/"muted" text are now properly getting colors
  2. text inside of embeds also have new colors!
  3. As a side effect of moving patch on a upper level it gets applied to a timestamp of a message and for pronouns ( if pronouns db is enabled or how is it called now )

Why use take className from a function call and not apply it imminently

With this approach i'm getting a bug

  1. When user doesn't have role/left the server they can't be resolved, so no --saturation and no --role-color which will result it a #000 text!
  2. When having potato pc/poor internet connection it can't resolve colors imminently, which also result in a black color for a few ms. Theme-based colors are preferred, so it's better use them while loading

The only thing I don't like is how i'm calling the same function twice, but i have no idea how to reduce it in this example

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.

1 participant