Skip to content

Conversation

@drichar
Copy link
Contributor

@drichar drichar commented Jan 20, 2026

Summary

Fixes the default avatar placeholder not being styled correctly in CSS-only setups. The fallback avatar icon was not centered and border-radius wasn't applied when NfdAvatar was used directly in consumer code.

Problem

The NfdAvatar fallback div uses Tailwind utility classes (flex, items-center, justify-center, rounded-full) that require the [data-wallet-ui] attribute for CSS scoping. When consumers use NfdAvatar directly in their code (outside of library button components), the element lacks a [data-wallet-ui] ancestor, so the scoped utility classes don't match.

Solution

Add data-wallet-ui attribute directly to the fallback avatar div, enabling the utility classes to match via the [data-wallet-ui].class selector pattern.

Test Plan

  • Build succeeds
  • Verify avatar is centered in react-css-only example
  • Verify avatar styling in react example still works

The fallback avatar div uses Tailwind utility classes (flex, items-center,
justify-center, rounded-full) that require the [data-wallet-ui] attribute
for CSS scoping. Without this, the classes don't apply when NfdAvatar is
used directly in consumer code outside of library components.

This fixes the avatar icon not being centered in CSS-only setups.
@drichar drichar merged commit b58b7a0 into beta Jan 20, 2026
2 checks passed
@drichar drichar deleted the fix/nfd-avatar-css-scoping branch January 20, 2026 21:45
txnlab-release-bot bot added a commit that referenced this pull request Jan 20, 2026
# [1.0.0-beta.2](v1.0.0-beta.1...v1.0.0-beta.2) (2026-01-20)

### Bug Fixes

* **NfdAvatar:** add data-wallet-ui for CSS utility scoping ([#31](#31)) ([b58b7a0](b58b7a0))
@txnlab-release-bot
Copy link
Contributor

🎉 This PR is included in version 1.0.0-beta.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

txnlab-release-bot bot added a commit that referenced this pull request Jan 21, 2026
# [1.0.0](v0.4.2...v1.0.0) (2026-01-21)

### Bug Fixes

* **css:** inject styles at start of head for consumer overrides ([#32](#32)) ([820c6c7](820c6c7))
* **NfdAvatar:** add data-wallet-ui for CSS utility scoping ([#31](#31)) ([b58b7a0](b58b7a0))
* **css:** use :where() for button reset to allow utility overrides ([#25](#25)) ([221c660](221c660))
* **css:** use Tailwind v3-compatible CSS variable syntax ([#24](#24)) ([a4aeeb7](a4aeeb7))

* feat(css)!: redesign CSS architecture for v1.0 ([fb6ccc3](fb6ccc3))

### BREAKING CHANGES

* CSS architecture has been redesigned for better
customization support and isolation.
@txnlab-release-bot
Copy link
Contributor

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant