tailwindlabs / tailwindcss-intellisense

Intelligent Tailwind CSS tooling for Visual Studio Code
2.74k stars 181 forks source link

The extension reports wrong suggestions #977

Closed brunouber closed 1 month ago

brunouber commented 1 month ago

What version of VS Code are you using?

v1.89.1

What version of Tailwind CSS IntelliSense are you using?

v0.10.5

What version of Tailwind CSS are you using?

v3.4.3

What package manager are you using?

npm

What operating system are you using?

macOS, Sonoma 14.4.1

Tailwind config

{
    "content": ["..."],
    "plugins": [],
    "theme": {
        "extend": {},
        "fontSize": {
            "base": "13px"
        }
    }
}

VS Code settings

{
  "workbench.colorTheme": "Default Dark Modern",
  "editor.fontSize": 16,
  "editor.renderWhitespace": "all",
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnSave": true,
  "git.mergeEditor": false,
  "terminal.integrated.fontSize": 14,
  "terminal.integrated.defaultProfile.osx": "zsh",
  "security.workspace.trust.untrustedFiles": "open",
  "typescript.updateImportsOnFileMove.enabled": "never",
  "javascript.updateImportsOnFileMove.enabled": "never",
  "diffEditor.hideUnchangedRegions.enabled": true,
  "files.associations": {
    "*.ejs": "plaintext"
  },
  "github.copilot.editor.enableAutoCompletions": true
}

Describe your issue

I'm trying to adopt tailwindcss in an existing project.

In this website the font-size defined on body is 13px - I can't change this at the moment.

When I use text-base, on hover, the extension correctly reports the corresponding value.

immagine

But when I use other tailwindcss's utilities, such as p-4 the extension reports the wrong value. When I visit the page later, p-4 is equal to 13px as it should be.

immagine
RobinMalfait commented 1 month ago

Hey!

This is because you set your base font size to 13px and the extension uses 16px by default. You can configure this in your extension settings: https://github.com/tailwindlabs/tailwindcss-intellisense?tab=readme-ov-file#tailwindcssrootfontsize

Hope this helps!

brunouber commented 1 month ago

Hey @RobinMalfait , Thanks a lot, this solved my issue.