Skip to content

Instantly share code, notes, and snippets.

@cptSwing
Created August 8, 2025 11:27
Show Gist options
  • Select an option

  • Save cptSwing/515aac6f1015dc8c3e06623f426385c3 to your computer and use it in GitHub Desktop.

Select an option

Save cptSwing/515aac6f1015dc8c3e06623f426385c3 to your computer and use it in GitHub Desktop.
configure tailwindCSS extension in VSCode to correctly show Intellisense info in strings prefaced with /* 'tw */, among others
"tailwindCSS.experimental.classRegex": [
"\\/\\*\\s*tw\\s*\\*\\/\\s*[`'\"](.*)[`'\"];?", // parse strings following a /* tw */ comment
["(?:\\b(?:const|let)\\s+)?[\\w$_]*(?:[Cc]lass[Nn]ame)[\\w\\d]*\\s*(?:=|\\+=)\\s*['\"]([^'\"]*)['\"]"], // parse strings such as 'testClassName', etc
["classList.(?:add|remove|toggle)\\(([^)]*)\\)", "(?:'|\"|`)([^\"'`]*)(?:'|\"|`)"] // parses DOM manip's, such as classList.add('') etc
],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment