skip to Main Content

I I have a project that consists of css, js, php files.

Css and js files are located in the /src folder and php files are simply in the root folder of the project.

I want to use tailwind and gulp with this project and get ready tailwind styles in the dist folder. But for some reason tailwind does not generate styles for php files.

So when I run – npm run dev I see styles for html,scss,js files but not for php files

tailwind.config.js

/** @type {import('tailwindcss').Config} */

export default {
  content: [
    './src/**/*.{html,scss,js}', 
    './*.{php}'
  ],
  theme: { ...

gulpfile.js

import { copy } from './gulp/tasks/copy.js';
import { copyRootFiles } from './gulp/tasks/copyRootFiles.js';
import { reset } from './gulp/tasks/reset.js';
import { html } from './gulp/tasks/html.js';
import { server } from './gulp/tasks/server.js';
import { scss } from './gulp/tasks/scss.js';
import { js } from './gulp/tasks/js.js';
import { images } from './gulp/tasks/images.js';
import { otfToTtf, ttfToWoff, fontStyle } from './gulp/tasks/fonts.js';
import { svgSprive } from './gulp/tasks/svgSprive.js';
import { zip } from './gulp/tasks/zip.js';
import { ftp } from './gulp/tasks/ftp.js';

global.app = {
  isBuild: process.argv.includes('--build'),
  isDev: !process.argv.includes('--build'),
  path: filePaths,
  gulp,
  plugins,
};

function watcher() {
  gulp.watch(filePaths.watch.static, copy);
  gulp.watch(filePaths.watch.html, html);
  gulp.watch(filePaths.watch.html, scss);
  gulp.watch(filePaths.watch.scss, scss);
  gulp.watch(filePaths.watch.js, js);
  gulp.watch(filePaths.watch.js, scss);
  gulp.watch(filePaths.watch.images, images);
  gulp.watch(filePaths.watch.php, scss);
}

I try this

tailwind.config.js

/** @type {import('tailwindcss').Config} */

export default {
  content: [
    './src/**/*.{html,scss,js}', 
    './*.{php}'
  ],
  theme: {

but it doesn’t worf for php files

3

Answers


  1. Have you tried:

    npx tailwindcss -i ./src/input.css -o ./dist/output.css --watch
    

    https://tailwindcss.com/docs/installation

    This might help with the integration:
    https://tailwindcss.com/docs/installation/using-postcss

    Login or Signup to reply.
  2. For php, test it like this and see if it works

    content: ["*.php"]
    
    Login or Signup to reply.
  3. I would try to run npx tailwind ... alone and see if it’s configuration is the actual problem.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search