Home

tailwind-ctp-intellisense @master - refs - log -
-
https://git.jolheiser.com/tailwind-ctp-intellisense.git
Tailwind intellisense + Catppuccin
tree log patch
Show completions when using parameterized and/or labelled variants
Brad Cornes <hello@bradley.dev>
2 years ago
1 changed files, 2 additions(+), 2 deletions(-)
M packages/tailwindcss-language-service/src/util/getVariantsFromClassName.ts -> packages/tailwindcss-language-service/src/util/getVariantsFromClassName.ts
diff --git a/packages/tailwindcss-language-service/src/util/getVariantsFromClassName.ts b/packages/tailwindcss-language-service/src/util/getVariantsFromClassName.ts
index 370be6b6f94a6d5fd7cdaa26f67664f58bb00d54..795569ed5202ba470be1a7c17afdacdd60b2686a 100644
--- a/packages/tailwindcss-language-service/src/util/getVariantsFromClassName.ts
+++ b/packages/tailwindcss-language-service/src/util/getVariantsFromClassName.ts
@@ -14,9 +14,9 @@   for (let part of parts) {
     if (
       allVariants.includes(part) ||
       (state.jit &&
-        part.startsWith('[') &&
+        ((part.includes('[') && part.endsWith(']')) ||
-import { State } from './state'
 ): { variants: string[]; offset: number } {
+export function getVariantsFromClassName(
         jit.generateRules(state, [`${part}${state.separator}[color:red]`]).rules.length > 0)
     ) {
       variants.add(part)