Change username color in chat with power level color (#2282)

* add active theme context

* add chroma js library

* add hook for accessible tag color

* disable reply user color - temporary

* render user color based on tag in room timeline

* remove default tag icons

* move accessible color function to plugins

* render user power color in reply

* increase username weight in timeline

* add default color for member power level tag

* show red slash in power color badge with no color

* show power level color in room input reply

* show power level username color in notifications

* show power level color in notification reply

* show power level color in message search

* render power level color in room pin menu

* add toggle for legacy username colors

* drop over saturation from member default color

* change border color of power color badge

* show legacy username color in direct rooms
This commit is contained in:
Ajay Bura
2025-03-23 22:09:29 +11:00
committed by GitHub
parent 7d54eef95b
commit 08e975cd8e
26 changed files with 463 additions and 91 deletions

View File

@@ -3,13 +3,30 @@ import { recipe, RecipeVariants } from '@vanilla-extract/recipes';
import { color, config, DefaultReset, toRem } from 'folds';
export const PowerColorBadge = style({
display: 'inline-block',
display: 'inline-flex',
alignItems: 'center',
justifyContent: 'center',
flexShrink: 0,
width: toRem(16),
height: toRem(16),
backgroundColor: color.Surface.OnContainer,
borderRadius: config.radii.Pill,
border: `${config.borderWidth.B300} solid ${color.Surface.ContainerLine}`,
border: `${config.borderWidth.B300} solid ${color.Secondary.ContainerLine}`,
position: 'relative',
});
export const PowerColorBadgeNone = style({
selectors: {
'&::before': {
content: '',
display: 'inline-block',
width: '100%',
height: config.borderWidth.B300,
backgroundColor: color.Critical.Main,
position: 'absolute',
transform: `rotateZ(-45deg)`,
},
},
});
const PowerIconSize = createVar();