Skip to content

fix(avatars): Use black background in dark mode for avatars#2178

Merged
mukunku merged 4 commits intobetafrom
sal/SPARK-148
Feb 6, 2026
Merged

fix(avatars): Use black background in dark mode for avatars#2178
mukunku merged 4 commits intobetafrom
sal/SPARK-148

Conversation

@mukunku
Copy link
Collaborator

@mukunku mukunku commented Feb 6, 2026

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:

    • image
    • image
  • 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.

    • Example: image
    • If we were to ditch the background color and let the image use its parent's background color we can utilize drop-shadow to 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-mode but doesn't seem like that's what we are looking for.

How to Test

@changeset-bot
Copy link

changeset-bot bot commented Feb 6, 2026

🦋 Changeset detected

Latest 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

@netlify
Copy link

netlify bot commented Feb 6, 2026

Deploy Preview for stacks-svelte ready!

Name Link
🔨 Latest commit 8fe4f66
🔍 Latest deploy log https://app.netlify.com/projects/stacks-svelte/deploys/6985f5900572710008ca0142
😎 Deploy Preview https://deploy-preview-2178--stacks-svelte.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Feb 6, 2026

Deploy Preview for stacks ready!

Name Link
🔨 Latest commit 8fe4f66
🔍 Latest deploy log https://app.netlify.com/projects/stacks/deploys/6985f5908d1f7d0009bd2c76
😎 Deploy Preview https://deploy-preview-2178--stacks.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@giamir giamir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mukunku for the research. I can get behind this choice. I cannot think honestly of better ways to go about it. All have compromises.

Copy link
Collaborator

@CGuindon CGuindon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok let's do it!

@mukunku mukunku merged commit 66498cc into beta Feb 6, 2026
19 checks passed
@mukunku mukunku deleted the sal/SPARK-148 branch February 6, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants