CodeWithDennis / filament-simple-alert

This package offers a straightforward and easy-to-use alert component for your Filament application. It allows you to quickly implement customizable alert messages, enhancing the user experience by providing clear and concise notifications.
MIT License
53 stars 6 forks source link

Some styles don't seem to be applying #7

Closed thursdaydan closed 2 months ago

thursdaydan commented 2 months ago

Hi there! I added this plugin to my project recently and whilst the bulk of it works fantastic, I have noticed some minor but import styles don't seem to be applying with tailwind.

I've spent all day going over this making sure it's nothing caused by me such as a bad config etc (It still may well be an issue on my end).

Anyway here is an image of how it renders on my local env. Screenshot 2024-08-27 at 14 45 55

It appears margin and colours are the main styles not being applied for some reason.

Usage inside an infolist:

    public static function infolist(Infolist $infolist): Infolist
    {
        return $infolist
            ->schema([
                SimpleAlert::make('success')
                    ->success()
                    ->title(new HtmlString('<strong>Hoorraayy! Your request has been approved! 🎉</strong>'))
                    ->description('Lorem ipsum dolor sit amet consectetur adipisicing elit.')
                    ->link('https://filamentphp.com')
                    ->linkLabel('Read more!')
                    ->linkBlank(true)->columnSpanFull(),
            ]);
    }

And here is my tailwind.config.js

import preset from './vendor/filament/support/tailwind.config.preset'

export default {
    presets: [preset],
    content: [
        './app/Filament/**/*.php',
        './resources/views/filament/**/*.blade.php',
        './vendor/filament/**/*.blade.php',
        './vendor/codewithdennis/filament-simple-alert/resources/**/*.blade.php',
    ],
}

Any help would be appreciated! Even it is just telling me I've made a schoolboy error somewhere!

Thanks for the package!

CodeWithDennis commented 2 months ago

Make sure you run npm run build @thursdaydan

thursdaydan commented 2 months ago

Thanks, I've ran that, also tried sail artisan filament:optimize-clear and tried publishing the filament assets all to no avail.

I've added filament on an existing API type laravel project, so I'm happy to chalk it up to something specific to my project.

CodeWithDennis commented 2 months ago

Thats odd, can you try on a new project and see if it persists?

Verringer commented 2 months ago

Can't comment on new projects, but I had this with a pre-existing app with a tailwind config set up before adding filament in.

Follow the instructions to set up a theme: https://filamentphp.com/docs/3.x/panels/themes#creating-a-custom-theme

This outputs separate css for filament, and then you apply it with ->viteTheme('resources/css/filament/{theme-name}/theme.css') to the panel. Putting it into /tailwind.config.js just meant classes were being built into the app.css but not linked to in the panel.

Remember to add in './vendor/codewithdennis/filament-simple-alert/resources/**/*.blade.php', to resources/css/filament/{theme-name}/tailwind.config.js

thursdaydan commented 2 months ago

Aye, that's cleared it up nicely. Good catch! Appreciate the help. 👍

CodeWithDennis commented 2 months ago

Thanks for the assist. @Verringer

thursdaydan commented 2 months ago

I'm happy to close this issue now as this is the solution. I suppose it'd be worth adding a mention in docs for others who may be installing the plugin into an existing project with tailwind already setup.