-
-
Save lambrospetrou/4a3c09a694120b9c3af9b8f170f0f5bb to your computer and use it in GitHub Desktop.
Regex for TailwindCSS + Gomponents
This file contains hidden or 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 hidden or 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