Created
December 15, 2023 05:41
-
-
Save eduardolat/438a1de077ccac6b9792153e708c1824 to your computer and use it in GitHub Desktop.
Regex for TailwindCSS + Gomponents
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @type {import('tailwindcss').Config} */ | |
module.exports = { | |
// Change this to your project source folder | |
content: ['./web/**/*.go'], | |
plugins: [], | |
theme: { | |
extend: {}, | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// Tailwind CSS + Gomponents | |
// It can handle single and multiple lines inside the matches | |
// It can handle double quotes (") and backticks (`) | |
"tailwindCSS.includeLanguages": { | |
"go": "go", | |
}, | |
"tailwindCSS.experimental.classRegex": [ | |
["Class\\(([^)]*)\\)", "[\"`]([^\"`]*)[\"`]"], // Class("...") or Class(`...`) | |
["Classes\\(([^)]*)\\)", "[\"`]([^\"`]*)[\"`]"], // Classes("...") or Classes(`...`) | |
["Class\\{([^)]*)\\}", "[\"`]([^\"`]*)[\"`]"], // Class{"..."} or Class{`...`} | |
["Classes\\{([^)]*)\\}", "[\"`]([^\"`]*)[\"`]"], // Classes{"..."} or Classes{`...`} | |
["Class:\\s*[\"`]([^\"`]*)[\"`]"], // Class: "..." or Class: `...` | |
["Classes:\\s*[\"`]([^\"`]*)[\"`]"], // Classes: "..." or Classes: `...` | |
], | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I got it working in GoLand without installing node dependencies with this little hack: https://youtrack.jetbrains.com/issue/WEB-55647/Support-Tailwind-css-autocompletion-using-standalone-tailwind-CLI#focus=Comments-27-10957961.0-0