refactor(css): separate theme and UI scoping attributes #30
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
Refactors the CSS scoping architecture to use two separate data attributes, fixing utility class leakage and enabling easier CSS variable overrides.
Problem: The previous architecture used
[data-wallet-ui]on the provider wrapper for both CSS variable definitions and utility class scoping. This caused:.hidden, etc.) to leak to consumer app elements inside the providerSolution: Split concerns between two attributes:
[data-wallet-theme]— Provider-level wrapper for CSS variable definitions (inherits to descendants)[data-wallet-ui]— Component-level attribute for utility class scoping (on buttons and portal wrappers)Key Changes
Provider and Components
WalletUIProviderwrapper usesdata-wallet-themefor CSS variablesConnectWalletButton,ConnectedWalletButton) adddata-wallet-uidirectlyConnectWalletMenu,ConnectedWalletMenu) use both attributesCSS Structure
[data-wallet-theme]selectors[data-wallet-ui][data-wallet-button][data-wallet-ui] [role="dialog"]Post-process Script
[data-wallet-ui].class— elements with attribute directly (buttons)[data-wallet-ui] .class— descendants (portal content)Documentation
[data-wallet-theme]Test Plan
pnpm test)pnpm lint)pnpm build)pnpm e2e:docker)