fix(read-receipts): prevent emoji color bleed in follower names

WebKit (Safari/iOS) has a rendering quirk where colorful emoji inside <b>
tags can contaminate the paint color of adjacent sibling text nodes. This
caused display names following a user with an emoji (e.g. '🔴 Alice') to
render with the emoji's color instead of the expected text color.

Apply -webkit-text-fill-color: inherit on <b> name tags and
-webkit-text-fill-color: currentColor on the following <Text as="span">
elements. This explicitly resets the WebKit fill color chain at each step,
preventing emoji paint properties from cascading into sibling spans.

Fixes #267
This commit is contained in:
Evie Gauthier committed 2026-03-16 14:57:13 -04:00
1 parent cf4c3905c8
commit 68c1ca19fa
1 file changed
+20 -20
+20 -20
View File
@@ -89,56 +89,56 @@ export const RoomViewFollowing = as<'div', RoomViewFollowingProps>(
<Text size="T300" truncate>
{names.length === 1 && (
<>
<b>{names[0]}</b>
<Text as="span" size="Inherit" priority="300">
<b style={{ WebkitTextFillColor: 'inherit' }}>{names[0]}</b>
<Text as="span" size="Inherit" priority="300" style={{ WebkitTextFillColor: 'currentColor' }}>
{' is following the conversation.'}
</Text>
</>
)}
{names.length === 2 && (
<>
<b>{names[0]}</b>
<Text as="span" size="Inherit" priority="300">
<b style={{ WebkitTextFillColor: 'inherit' }}>{names[0]}</b>
<Text as="span" size="Inherit" priority="300" style={{ WebkitTextFillColor: 'currentColor' }}>
{' and '}
</Text>
<b>{names[1]}</b>
<Text as="span" size="Inherit" priority="300">
<b style={{ WebkitTextFillColor: 'inherit' }}>{names[1]}</b>
<Text as="span" size="Inherit" priority="300" style={{ WebkitTextFillColor: 'currentColor' }}>
{' are following the conversation.'}
</Text>
</>
)}
{names.length === 3 && (
<>
<b>{names[0]}</b>
<Text as="span" size="Inherit" priority="300">
<b style={{ WebkitTextFillColor: 'inherit' }}>{names[0]}</b>
<Text as="span" size="Inherit" priority="300" style={{ WebkitTextFillColor: 'currentColor' }}>
{', '}
</Text>
<b>{names[1]}</b>
<Text as="span" size="Inherit" priority="300">
<b style={{ WebkitTextFillColor: 'inherit' }}>{names[1]}</b>
<Text as="span" size="Inherit" priority="300" style={{ WebkitTextFillColor: 'currentColor' }}>
{' and '}
</Text>
<b>{names[2]}</b>
<Text as="span" size="Inherit" priority="300">
<b style={{ WebkitTextFillColor: 'inherit' }}>{names[2]}</b>
<Text as="span" size="Inherit" priority="300" style={{ WebkitTextFillColor: 'currentColor' }}>
{' are following the conversation.'}
</Text>
</>
)}
{names.length > 3 && (
<>
<b>{names[0]}</b>
<Text as="span" size="Inherit" priority="300">
<b style={{ WebkitTextFillColor: 'inherit' }}>{names[0]}</b>
<Text as="span" size="Inherit" priority="300" style={{ WebkitTextFillColor: 'currentColor' }}>
{', '}
</Text>
<b>{names[1]}</b>
<Text as="span" size="Inherit" priority="300">
<b style={{ WebkitTextFillColor: 'inherit' }}>{names[1]}</b>
<Text as="span" size="Inherit" priority="300" style={{ WebkitTextFillColor: 'currentColor' }}>
{', '}
</Text>
<b>{names[2]}</b>
<Text as="span" size="Inherit" priority="300">
<b style={{ WebkitTextFillColor: 'inherit' }}>{names[2]}</b>
<Text as="span" size="Inherit" priority="300" style={{ WebkitTextFillColor: 'currentColor' }}>
{' and '}
</Text>
<b>{names.length - 3} others</b>
<Text as="span" size="Inherit" priority="300">
<b style={{ WebkitTextFillColor: 'inherit' }}>{names.length - 3} others</b>
<Text as="span" size="Inherit" priority="300" style={{ WebkitTextFillColor: 'currentColor' }}>
{' are following the conversation.'}
</Text>
</>