Provides a code action for fast class name refactorings for Svelte + React, speeding up your Tailwind / utility-CSS workflows.
Shows up as a code action (bulb icon / Alt+Enter), no explicit command needed.
Wrap and unwrap, with configurable helper functions like cn or clsx.
No more class={cn(…)} hand-typing 😌
class="px-4" → class={cn("px-4", <cursor>)}class={fooClasses} → class={cn(fooClasses, <cursor>)}
class={cn("px-4")} → class="px-4"class={cn(fooClasses)} → class={fooClasses}
Alt+Enter targeting caret) or the command palette command.class) and React / TSX (className).cn, cx, clsx, …).cnHelper.functionName (default: cn).
Not published to the Marketplace yet (still dogfooding). Install via VSIX for now.
Pre-build VSIX: Download the .vsix from a GitHub Release

Built the VSIX yourself: pnpm install → pnpm run install:local
More details: DEVELOPMENT.md
cn? 🤔cn is a class composition helper you might define in your web frontend project:
clsx).twMerge from tailwind-merge).p-2 p-4” duplicates.tailwind-variants.import { clsx, type ClassValue } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
Minimal example:
<span
class={cn(
"px-2 py-1 text-sm",
active ? "text-white" : "text-zinc-400",
disabled && "text-zinc-600",
className /* allow overrides → composition */
)}
>
{label}
</span>
svelte, javascriptreact, and typescriptreact files.
{…} are left unchanged
Developer setup / local packaging docs: see DEVELOPMENT.md.