Skip to content

Instantly share code, notes, and snippets.

@renatorib
Created November 14, 2023 16:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save renatorib/19f2f832479e8cbe5131548c948aa796 to your computer and use it in GitHub Desktop.
Save renatorib/19f2f832479e8cbe5131548c948aa796 to your computer and use it in GitHub Desktop.
Tailwind classRegex vscode
"tailwindCSS.experimental.classRegex": [
// const foo = cn("...")
// const foo = cx("...")
// const foo = classnames("...")
["cn|cx|classnames\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
// <Component classNames={{ foo: "..." }} />
["classNames=\\{([^}]*)\\}", "[\"'`]([^\"'`]*).*?[\"'`]"],
// const foo = /* tw */ "..."
["/\\* tw \\*/ ?(.*)", "[\"'`]([^\"'`]*).*?[\"'`]"],
// const foo = /* tw */ { bar: "...", baz: "..." }
["/\\* tw \\*/ ?\\{([^}]*)\\}", "[\"'`]([^\"'`]*).*?[\"'`]"]
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment