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

Assign the --user-color-* CSS variables which allows referencing the chosen color of a specific player or the current user in CSS in a way that is resilient to later color changes. #9771

Closed
mouse0270 opened this issue Jul 16, 2023 · 1 comment
Assignees
Labels
ui Issues focused on user interface improvements

Comments

@mouse0270
Copy link

User Experience

When a player logins in create and set a custom css variable based on that player's color selection, when the player updates their color, update the css variable to match.

Why is this important?

Well, its not, but also, from what I can tell, player color doesn't do much already, this would allow developers to integrate this in a way that keeps it consistent.

How would it work?

My idea is that you could create a css variable that is formatted like --player-color-PlayerID. For example, at least in the D&D5e System player color is used to theme the border of chat messages by doing border-color: CURRENT_PLAYER_COLOR;. however this is static, if the player changes their color later, or in another session, it still their old color.

But having a css variable attached to a player, you could do something like this: border-color: var(--player-color-1eYC0irr8ZBrzXfK, CURRENT_PLAYER_COLOR);. This would use the players color and even update as they change it, and if they were missing, it would use their initial color.

Bonus Points if you save the player color and css variable even if that player isn't logged in so that it still just works until they change it again

Why do I want this?

Well honestly, I was working on a character sheet, and sort of implemented this exact mechanic because I thought it would give the sheets some more color by using the players color in the sheet design. The players can make things feel more like their own. In my example, the header and some elements are styled using the players chosen color

Whelp, this is my useless feature request... Honestly could care less if your just like, naw and close this ticket, just thought it would be a fun way for UI nerds like me to make modules using the players colors to make it feel more unique.

To be clear, this feature request is completely useless all it does is provide something that no one but me might ever actually use. haha

@aaclayton
Copy link
Contributor

It's a good suggestion and would be a good way to make things like chat messages resilient to changes in player color.

@aaclayton aaclayton added the ui Issues focused on user interface improvements label Jul 17, 2023
@aaclayton aaclayton self-assigned this May 13, 2024
@aaclayton aaclayton added this to the V12 User Testing 4 milestone May 13, 2024
@aaclayton aaclayton changed the title Provide Access to Player Colors via CSS variables Assign the --user-color-* CSS variables which allows referencing the chosen color of a specific player or the current user in CSS in a way that is resilient to later color changes. May 17, 2024
@aaclayton aaclayton changed the title Assign the --user-color-* CSS variables which allows referencing the chosen color of a specific player or the current user in CSS in a way that is resilient to later color changes. Assign the --user-color-* CSS variables which allows referencing the chosen color of a specific player or the current user in CSS in a way that is resilient to later color changes. May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ui Issues focused on user interface improvements
Projects
Status: Done
Development

No branches or pull requests

2 participants