Skip to content

Tailwind stylesheets are not generated for stylesheets other than app.css #78

@kniziol

Description

@kniziol

The problem

If you define more than one input_css path in the config/packages/symfonycasts_tailwind.yaml configuration file, Tailwind stylesheets are not generated for that CSS inputs:

# config/packages/symfonycasts_tailwind.yaml

symfonycasts_tailwind:
    input_css:
        - assets/app/styles/app.css
        - assets/orange-pizza/styles/orange-pizza.css
        - assets/brave-elephant/styles/brave-elephant.css

Please see an example in the following repository:
https://github.com/kniziol/TailwindBundle-and-AssetMapper

Steps to reproduce the issue

  1. Clone https://github.com/kniziol/TailwindBundle-and-AssetMapper repo

  2. Install DDEV. See more: Get Started

  3. Run the following commands to start the project:

    ddev composer install
    ddev launch
  4. Go to https://symfony-asset-mapper-paths-separation.ddev.site/brave/elephant

  5. See the error:

    An exception has been thrown during the rendering of a template ("Built Tailwind CSS file does not exist: run "php bin/console tailwind:build" to generate it").
    
  6. Run the command:

    ddev console tailwind:build

    See output similar to this one:

     ! [NOTE] Downloading TailwindCSS binary from https://github.com/tailwindlabs/tailwindcss/releases/download/v3.4.17/tailwindcss-linux-arm64
    
     40525732/40525732 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
     ! [NOTE] Executing Tailwind (pass -v to see more details).                                                             
    
    
    Rebuilding...
    
    Done in 90ms.
  7. Refresh the page: https://symfony-asset-mapper-paths-separation.ddev.site/brave/elephant

  8. Unfortunately, the error still exists 👇

TailwindBundle - Built Tailwind CSS file does not exist

More information

Stylesheet for the app entrypoint has been generated only:

ls -alh var/tailwind/
total 24
drwx------@ 4 kn  staff   128B Jan  5 19:00 .
drwx------@ 5 kn  staff   160B Jan  5 18:59 ..
-rw-------@ 1 kn  staff    10K Jan  5 19:00 app.built.css // <------- Here
drwx------@ 3 kn  staff    96B Jan  5 19:00 v3.4.17

I expected stylesheets generated for all CSS inputs defined in the configuration file:

# config/packages/symfonycasts_tailwind.yaml

symfonycasts_tailwind:
    input_css:
        - assets/app/styles/app.css
        - assets/orange-pizza/styles/orange-pizza.css
        - assets/brave-elephant/styles/brave-elephant.css

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions