Skip to content

unexpected 'tw-' prefix being suggested, tailwind colour hints only being shown with these 'tw-' prefixes... #1283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
MattAppleton opened this issue Mar 23, 2025 · 3 comments
Labels
question Further information is requested

Comments

@MattAppleton
Copy link

What version of VS Code are you using?
1.98.2

What version of Tailwind CSS IntelliSense are you using?
0.14.11

What version of Tailwind CSS are you using?
"tailwindcss": "^4.0.15",

What package manager are you using?
npm

What operating system are you using?
OSX 15.3.2

Tailwind config

export default {
    prefix: '', // or just remove this line
    // other config...
  }

VS Code settings

{
  "git.ignoreMissingGitWarning": true,
  "filePropertiesViewer.outputStylePath": "",
  "editor.linkedEditing": true,
  "editor.wordWrap": "on",
  "editor.minimap.enabled": false,
  "[css]": {
    "editor.defaultFormatter": "vscode.css-language-features"
  },
  "security.workspace.trust.untrustedFiles": "open",
  "better-comments.tags": [
    {
      "tag": "!",
      "color": "#FF2D00",
      "strikethrough": false,
      "underline": false,
      "backgroundColor": "transparent",
      "bold": false,
      "italic": false
    },
    {
      "tag": "?",
      "color": "#FC40A7",
      "strikethrough": false,
      "underline": false,
      "backgroundColor": "transparent",
      "bold": false,
      "italic": false
    },
    {
      "tag": "//",
      "color": "#474747",
      "strikethrough": true,
      "underline": false,
      "backgroundColor": "transparent",
      "bold": false,
      "italic": false
    },
    {
      "tag": "todo",
      "color": "#FF8C00",
      "strikethrough": false,
      "underline": false,
      "backgroundColor": "transparent",
      "bold": false,
      "italic": false
    },
    {
      "tag": "*",
      "color": "#C27CF8",
      "strikethrough": false,
      "underline": false,
      "backgroundColor": "transparent",
      "bold": false,
      "italic": false
    }
  ],
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "files.autoSave": "onFocusChange",
  "liveServer.settings.CustomBrowser": "chrome",

  "prettier.singleQuote": true,
  "prettier.trailingComma": "none",
  "prettier.bracketSpacing": true,
  "prettier.arrowParens": "avoid",
  "prettier.endOfLine": "lf",
  "prettier.printWidth": 180,
  "prettier.semi": true,
  "prettier.useTabs": false,
  "prettier.tabWidth": 2,
  "prettier.proseWrap": "preserve",
  "prettier.jsxSingleQuote": false,
  "prettier.jsxBracketSameLine": false,
  "prettier.htmlWhitespaceSensitivity": "css",
  "prettier.insertPragma": false,
  "prettier.requirePragma": false,
  "prettier.quoteProps": "as-needed",
  "prettier.bracketSameLine": false,
  "prettier.singleAttributePerLine": false,
  "[jsonc]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "todohighlight.defaultStyle": {},
  "todohighlight.isEnable": true,
  "todohighlight.keywords": [
    {
      "text": "NOTE:",
      "color": "#ff0000",
      "backgroundColor": "yellow",
      "overviewRulerColor": "grey"
    }
  ],
  "liveServer.settings.donotVerifyTags": true,
  "liveServer.settings.donotShowInfoMsg": true,
  "[typescript]": {
    "editor.defaultFormatter": "vscode.typescript-language-features"
  },
  "workbench.editor.enablePreview": false,
  "workbench.editorAssociations": {
    "*.svg": "default"
  },
  "github.copilot.selectedCompletionModel": "gpt-4o-copilot",
  "[html]": {
    "editor.defaultFormatter": "vscode.html-language-features"
  },
  "[twig]": {
    "editor.defaultFormatter": "mblode.twig-language-2"
  },
  "github.copilot.enable": {
    "*": false,
    "plaintext": false,
    "markdown": false,
    "scminput": false
  },
  "auto-close-tag.activationOnLanguage": [
    
    "xml",
    "php",
    "blade",
    "ejs",
    "jinja",
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact",
    "plaintext",
    "markdown",
    "vue",
    "liquid",
    "erb",
    "lang-cfml",
    "cfml",
    "HTML (EEx)",
    "HTML (Eex)",
    "plist"
  ],
 
}

Reproduction URL

n/a

Describe your issue

Tailwind classes have started to be suggested with a 'tw-' prefix — without me having (knowingly!) asked for this.

What is particularly annoying is that the NON tw-prefix tailwind colors no longer have the useful colour swatch, while the 'tw-' prefix ones do?!!

See attached

Image

here-s a screenshot of what the prompt does — I want to carry on using 'regualr' tailwind classes without the prefix ideally!
Image

See screenshot below

@thecrypticace
Copy link
Contributor

Hey! I'm gonna definitely need a reproduction for this. Especially because:

  1. Tailwind CSS v4 uses tw: as a prefix at the beginning of the class name rather than tw- in the middle (between variants and the utility name)
  2. This suggests that IntelliSense is picking up Tailwind CSS v3.x and not v4 per your comment saying you're using v4.0.15
  3. IntelliSense uses Tailwind CSS itself to generate suggestions so it seems that v3 also thinks a prefix is being used and is configured to tw-

If you are definitely using v4 then it might be invalid CSS causing it to fail to discover / parse stuff. And maybe the presence of the config file is triggering a fallback to v3 but if the config file doesn't have a prefix inside that would be incredibly weird since it's obviously being picked up from somewhere.

@thecrypticace thecrypticace added the question Further information is requested label Mar 24, 2025
@MattAppleton
Copy link
Author

Its very odd. Im trying tailwind v4 on another project atm and this issue is NOT present. Only real difference is that the other project uses Vite. Both running on DDEV.

Interestingly the issue is present on two different machines / locations — home setup using MBPro, then a Mac Studio machine — obv. both running off the same repo + DDEV setup though... so should be same codebase.

Old projects running Tw v3 are fine still, must be something with my VScode workspace, Im inclined to try setting a new project folder. Will do this later today. I'll try updating another project to TW4.

If you wanted to see a reproduction, im not too sure what the best way to achieve this is, I could share the repo for this problem project?

@thecrypticace
Copy link
Contributor

@MattAppleton yeah sharing the repo is sufficient if you're able to do that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants