fix: Initials are unreadable on light colored avatar background

This commit is contained in:
Tom Moor
2025-02-19 23:39:55 -05:00
parent 83da38afd5
commit 78ff3af801

View File

@@ -1,3 +1,4 @@
import { getLuminance } from "polished";
import styled from "styled-components";
import { s } from "@shared/styles";
import Flex from "~/components/Flex";
@@ -15,7 +16,10 @@ const Initials = styled(Flex)<{
border-radius: 50%;
width: 100%;
height: 100%;
color: ${s("white75")};
color: ${(props) =>
getLuminance(props.color ?? props.theme.textTertiary) > 0.5
? s("black50")
: s("white75")};
background-color: ${(props) => props.color ?? props.theme.textTertiary};
width: ${(props) => props.size}px;
height: ${(props) => props.size}px;