Skip to content

Remove @headlessui/react Transition in Favor of Pure CSS #129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

thewebartisan7
Copy link

@thewebartisan7 thewebartisan7 commented Jun 12, 2025

Summary

This PR removes the dependency on @headlessui/react for transition effects and replaces its usage with a simpler, Tailwind-based CSS approach. This helps streamline the stack and aligns the project more closely with the existing usage of shadcn/ui and Tailwind utility classes.

Changes

Replaced the Transition component from @headlessui/react in the Profile and Password page component success message with a Tailwind CSS opacity transition.

Updated conditional rendering logic to animate the "Saved" message using native CSS transitions (transition-opacity, opacity-0, opacity-100).

Removed unnecessary dependency on @headlessui/react where it was only used for this purpose.

Motivation

Maintain consistency with shadcn/ui, which is already used throughout the project.
Reduce bundle size by eliminating unused dependencies.
Simplify component logic by leveraging Tailwind’s built-in transition utilities.
Avoid importing a full animation library for minor UI feedback.

Impact

No functional change in user experience: the "Saved" message still fades in/out on successful form update.
Cleaner and more maintainable codebase.

@headlessui/react may now be removed from the project entirely.

Testing

Verified that the "Saved" message correctly appears and fades in/out when profile data is saved.
No visual regressions or console warnings observed during manual testing.

Before & After

Before:

<Transition
  show={recentlySuccessful}
  enter="transition ease-in-out"
  enterFrom="opacity-0"
  leave="transition ease-in-out"
  leaveTo="opacity-0"
>
  <p className="text-sm text-neutral-600">Saved</p>
</Transition>

After:

<p
  className={`text-sm text-neutral-600 transition-opacity duration-300 ${
    recentlySuccessful ? 'opacity-100' : 'opacity-0'
  }`}
>
  Saved
</p>

Remove headlessui/react dependency
Remove headlessui/react dependency
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.

1 participant