Skip to content

@dashforge/tw: <Accordion> hardcodes light-mode neutral classes, breaks in dark mode (G-22) #109

Description

@kensaadi

Symptom

@dashforge/tw@1.1.1 <Accordion> items hardcode light-mode Tailwind classes (border-neutral-200, text-neutral-700, text-neutral-500, text-neutral-400). In dark mode (data-dash-tw-theme="dark"), these neutrals do NOT invert automatically — dividers become invisible against dark backgrounds, and secondary text drops to near-invisible contrast.

Why this is bad

  • Users switching to dark mode see broken Accordion chrome without any explicit override on their side
  • Consumer forced to scope CSS overrides with [data-app='builder'] .accordion-item { … } to patch appearance
  • Contradicts the Dashforge default preset contract — neutral tokens are expected to auto-invert via the preset CSS var swap; components must not defeat that by hardcoding raw Tailwind neutrals

Discovered while

Refactoring the Blueprint Builder V2 shell. Filed in Blueprint's dogfood report as G-22 (severity: medium — visible regression in dark mode).

Workaround applied in Blueprint

Scoped CSS overrides in tokens.css using [data-app='builder'].

Acceptance

  • Accordion item internal classes swap to token-driven equivalents (border-[var(--dash-border)], text-[var(--dash-text-*)] etc.) so the preset CSS var swap does the right thing in both modes
  • Visual verification in dashforge-docs-lab playground (light + dark toggle) — dividers visible and secondary text at readable contrast in both modes
  • Regression test: render Accordion under data-dash-tw-theme="dark" and assert computed border color is not the light neutral-200 rgb value

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpackage:twAffects @dashforge/tw package

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions