spatie / laravel-mix-purgecss

Zero-config Purgecss for Laravel Mix
https://spatie.be/en/opensource
MIT License
874 stars 38 forks source link

Laravel blade component classes not being discovered #86

Closed booni3 closed 4 years ago

booni3 commented 4 years ago

Commenting classes inside the blade.php file works as expected, but should we expect css classes defined within the PHP class of to be found too?

This works...

{{-- bg-gray-100 text-gray-800' --}}
<span {{ $attributes->merge() }}>
  {{ $slot }}
</span>

This does not work...

public function __construct($colour = 'gray')
{
    if ($colour == 'gray') {
        $this->colour = 'bg-gray-100 text-gray-800';
    }
}
<span {{ $attributes->merge(['class' => $colour]) }}>
  {{ $slot }}
</span>
sebastiandedeyne commented 4 years ago

This package scans the following (and more) for content:

If your Blade component files are stored in either of those, it should work. Where are your component classes?

spatie-bot commented 4 years ago

Dear contributor,

because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.