Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Support setting username and avatar colors in custom themes #4503

Merged
merged 7 commits into from
Apr 28, 2020

Conversation

bwindels
Copy link
Contributor

@bwindels bwindels commented Apr 27, 2020

Partially overlaps with #4373, but introduces fewer new symbols in the custom theming JSON blob. Also supports avatar backgrounds.

Documentation updates at element-hq/element-web#13406

so the button in the toasts has the correct background color
We still need to convert them to URLs for the notification icon,
so use a canvas (with a cache in front of it) to do that.
@turt2live
Copy link
Member

@bwindels have we considered the security implications of this?

@bwindels
Copy link
Contributor Author

bwindels commented Apr 27, 2020

@bwindels have we considered the security implications of this?

Oooh, not at all 🤦 I guess if I ensure it is a hex color it would be fine?

@turt2live
Copy link
Member

It's more that allowing people to change them can lead to themes which remove/alter the disambiguation technique.

@bwindels
Copy link
Contributor Author

It's more that allowing people to change them can lead to themes which remove/alter the disambiguation technique.

Hmm, I see. People are in control though of the theme they choose?

@turt2live
Copy link
Member

I guess so. This is the consideration part of the conversation :p

It's probably fine, assuming product is okay with it.

@bwindels
Copy link
Contributor Author

It's probably fine, assuming product is okay with it.

They are asking for it :)

@turt2live
Copy link
Member

that needs to be captured somewhere public :(

Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm assuming tests pass

@bwindels bwindels merged commit 3d094ea into develop Apr 28, 2020
@fooness
Copy link

fooness commented Apr 29, 2020

Just tried using "username-colors": ["#rrggbb", "#rrggbb", "#rrggbb", "#rrggbb", "#rrggbb", "#rrggbb", "#rrggbb", "#rrggbb"] as well as "avatar-background-colors": ["#rrggbb", "#rrggbb", "#rrggbb"] in my config.json on a fresh build of 1.6.0-rc4, but unfortunately that didn’t work.

Using "username-colors_1": "#rrggbb" (and 2, 3, …) worked! Could not verify the same for single definitions of avatar-background-colors, though. Not sure if I did anything wrong, I bet it was tested before being merged … but I also don’t know what I might have done wrong in my config.json

@t3chguy
Copy link
Member

t3chguy commented Apr 30, 2020

This isn't in 1.6.0-rc4. It is only in develop.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants