fix(avatars): Use black background in dark mode for avatars#2178
Merged
fix(avatars): Use black background in dark mode for avatars#2178
Conversation
🦋 Changeset detectedLatest commit: 8fe4f66 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for stacks-svelte ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for stacks ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
dancormier
approved these changes
Feb 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Our avatars are hardcoded to use a white background which doesn't look great in dark mode when used with transparent images. This PR makes the background color dynamic (white/black) based on the user's selected theme.
Considerations
I believe the main reason we have a background color is to frame the avatar and make its boundaries distinct in case of a different background color. Preventing any transparent avatars from blending with the background. Examples:
Another thing to consider is the common practice of images that aren't transparent originally and were aliased against a white background being made transparent after the fact. With the background color we are applying there isn't much we can do about this: users will need to use proper transparent PNG images if they want it to look good.
drop-shadowto try soften the rough edges a bit but I feel it's a hack at best as the color needs to be set for the shadow and it might not look right in all cases.I also briefly looked into
mix-blend-modebut doesn't seem like that's what we are looking for.How to Test