tailwind-tree
Version:
A utility for writing deeply nested and composable Tailwind CSS classes using an expressive tree structure, supporting responsive and interactive variants for Tailwind v3 and v4.
13 lines (12 loc) • 522 B
TypeScript
/**
* Extracts all Tailwind classes from a source string.
* This includes:
* 1. Classes defined via `twTree([...])` nested syntax
* 2. Traditional string-based class detection (standard Tailwind strategy)
*
* This function is compatible with Tailwind v3 `content.extract` for custom class detection.
*
* @param content - The source code string (e.g. from .tsx/.js/.vue files)
* @returns Array of unique Tailwind class names used in the file
*/
export declare function extractTwTree(content: string): string[];