website icon indicating copy to clipboard operation
website copied to clipboard

Refactor(navbar): Use twMerge for z-index className management instead of template literal

Open Sam-61s opened this issue 11 months ago • 6 comments

Problem

NavBar.tsx (line 147) uses template literal for className concatenation instead of twMerge, which is the established pattern used throughout the codebase.

Current: <div className={bg-white ${className} z-50}>

Expected: <div className={twMerge('bg-white z-50', className)}>

Issues

  • Inconsistent with codebase conventions (a lot of components use twMerge)
  • Hardcoded z-50 should be in base className
  • Template literals don't handle Tailwind class conflicts properly

Solution

Import twMerge from tailwind-merge and use it for className management, following the pattern used in Button.tsx, TOC.tsx, and other components.

Benefits

  • ✅ Consistent with codebase conventions
  • ✅ Proper class conflict resolution
  • ✅ Better CSS organization
  • ✅ Improved maintainability
  • ✅ Allows proper className prop overrides

Related Files

Example of proper twMerge usage

  • components/buttons/Button.tsx
  • components/TOC.tsx
  • components/typography/Paragraph.tsx

Sam-61s avatar Dec 26 '25 02:12 Sam-61s

Hi! @princerajpoot20 I've fixed the NavBar className issue (a small refactor) to match the codebase pattern. Let me know if this looks good and I'll open a PR! 👍

Sam-61s avatar Dec 26 '25 02:12 Sam-61s

Hi @princerajpoot20 I can help in fixing this issue. Let me know if i can open a PR?

KariraLakshya avatar Dec 26 '25 09:12 KariraLakshya

@Sam-61s Can you please watch out for other such places in the codebase where twMerge isn't used but should be used. Add all such changes in the same PR.

anshgoyalevil avatar Dec 30 '25 13:12 anshgoyalevil

Is this issue open? Can i work on this

aaryab27 avatar Jan 11 '26 05:01 aaryab27

Is this issue open? Can i work on this

hey @aaryab27 I have already raised a PR and waiting for its review !!

Sam-61s avatar Jan 11 '26 08:01 Sam-61s

This issue has been automatically marked as stale because it has not had recent activity :sleeping:

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience :heart:

github-actions[bot] avatar May 31 '26 01:05 github-actions[bot]