Tailwind path for php

hi ,
can somebody help ?
tailwind intellisence dsnt work on php-page in vs-code.
here is the img.

So have you done the steps listed in their troubleshooting faq? Particularly the last one?

I’m gonna go ahead and guess your config file is badly formatted. Look at the coloration on line 22. You’ve accidentally closed your comment mid-line.

no , i used without commented part , but it dsnt work.

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: ["./index.html"],
  theme: {
    extend: {},
  },
  plugins: [],
}

it works only for index.html
and not for php.
in commented code , are values i have tried in content: [“./index.html”],

what
will be correct value in content: [" ."] for php pages ?
thnks

A wild stab in the dark here, but looking at the docs, you have included languages

If you click on the built in languages link ‘php’ is on the list
https://github.com/tailwindlabs/tailwindcss-intellisense/blob/master/packages/tailwindcss-language-service/src/util/languages.ts

I could be way off here, but could it be something along the lines of adding this to your config?

{
  "tailwindCSS.includeLanguages": {
    "plaintext": "php"
  }
}

Well for one this will work for PHP because tailwind is in by default for Laravel. Secondly, did you try just using ['./home.php'] and see if that works? By reference, here is how Laravel has it out of the box…

content: [
        './vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php',
        './storage/framework/views/*.php',
        './resources/views/**/*.blade.php',
]

Also don’t try to make one line match multiple file types. It is an array after all, so make each file match its own entry in the array. Just like you see above. You might have one that is for *.php and another for *.html etc.

I hope this helps. :slight_smile:

1 Like

I tried this ,

*content: [". / .php" ],

**content: [". / .php" , ". / .html"],

but still it ,dsnt work with php.in vs-code

I wonder if you tried
{
“tailwindCSS.includeLanguages”: {
“php”: “html”
}
}
and it doesn’t work :thinking:

is it right ?

what is wrong with this ?
thnks in advance.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.