Skip to content

Conversation

@pasevin
Copy link
Collaborator

@pasevin pasevin commented Jan 5, 2026

Summary

Fix missing responsive Tailwind CSS classes (xl:hidden, xl:flex, xl:block, xl:flex-col) in production builds after the UI kit extraction to npm packages.

Problem

After migrating UI packages to npm, the sidebar layout was broken on staging because Tailwind wasn't generating responsive classes. The root cause:

  1. pnpm installs packages as symlinks: node_modules/@openzeppelin/ui-components.pnpm/@openzeppelin+ui-components@1.0.1.../
  2. The @source "../../../node_modules/@openzeppelin" directive scanned a directory containing symlinks
  3. Tailwind v4 doesn't properly follow symlinks when scanning for class names
  4. Responsive classes from npm packages were missed during the build

Solution

Explicitly list each npm package that contains Tailwind classes:

@source "../../../node_modules/@openzeppelin/ui-components";
@source "../../../node_modules/@openzeppelin/ui-renderer";
@source "../../../node_modules/@openzeppelin/ui-react";

When specifying a path directly to a symlink (rather than its parent directory), the filesystem resolver follows it to the actual location containing the source files.

Testing

  • Verified locally that production build CSS now contains xl:block, xl:flex, xl:flex-col, xl:hidden classes
  • Tested sidebar layout at 1400px width - displays correctly

The previous @source directive pointed to node_modules/@OpenZeppelin
which contains symlinks to .pnpm directory. Tailwind v4 doesn't follow
these symlinks properly when scanning for class names.

This fix explicitly lists each npm package that contains Tailwind classes:
- @openzeppelin/ui-components
- @openzeppelin/ui-renderer
- @openzeppelin/ui-react

This ensures responsive classes like xl:hidden, xl:flex, etc. are
properly detected and included in the final CSS output.
@pasevin pasevin requested a review from a team as a code owner January 5, 2026 15:02
@pasevin pasevin merged commit 54e627a into main Jan 5, 2026
11 checks passed
@pasevin pasevin deleted the fix/tailwind-explicit-npm-sources branch January 5, 2026 15:07
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.

2 participants