Skip to content

[bug]: Sidebar component uses incorrect Tailwind CSS syntax for CSS variables #8242

@hughlv

Description

@hughlv

Bug Description

The sidebar component uses incorrect Tailwind CSS syntax for CSS custom properties, causing the sidebar to have zero width and not display properly.

Current Behavior

The sidebar component uses syntax like:

  • w-(--sidebar-width)
  • w-(--sidebar-width-icon)

This syntax doesn't work with Tailwind CSS and results in the sidebar having 0px width.

Expected Behavior

The sidebar should use proper Tailwind CSS arbitrary value syntax:

  • w-[var(--sidebar-width)]
  • w-[var(--sidebar-width-icon)]

Affected Code Locations

In the sidebar.tsx component, the following lines need correction:

  1. Line ~173: w-(--sidebar-width)w-[var(--sidebar-width)]
  2. Line ~190: w-(--sidebar-width)w-[var(--sidebar-width)]
  3. Line ~221: w-(--sidebar-width)w-[var(--sidebar-width)]
  4. Line ~226: w-(--sidebar-width-icon)w-[var(--sidebar-width-icon)]
  5. Line ~232: w-(--sidebar-width)w-[var(--sidebar-width)]
  6. Line ~239: w-(--sidebar-width-icon)w-[var(--sidebar-width-icon)]

Steps to Reproduce

  1. Install the sidebar component using the CLI or copy from the website
  2. Use the sidebar component in a Next.js app with the standard setup from docs
  3. The sidebar will render with 0px width

Environment

  • Next.js 15
  • Tailwind CSS 3.x
  • React 19

Fix

Replace all instances of w-(--sidebar-width) with w-[var(--sidebar-width)] and w-(--sidebar-width-icon) with w-[var(--sidebar-width-icon)] in the sidebar component.

This ensures Tailwind CSS properly interprets the CSS custom properties.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions