Custom theme: styles not applying
luanfreitasdev opened this issue · 1 comments
Discussed in #1477
Originally posted by keH1 March 26, 2024
Hello everyone, I've encountered a problem and can't figure out what's wrong. I'm trying to customize a table as instructed in the customization guide, and created my own class 'theme' => \App\Themes\TableGridTheme::class,
and registered it in the config. Like in instruction: https://livewire-powergrid.com/table/custom-theme.html
I inherited from the Tailwind theme, refreshed the page - nothing works. Added to the search box a class "eewfewfwef", deleted all the others - refreshed the page - nothing.
I reverted to the classic theme 'theme' => \PowerComponents\LivewirePowerGrid\Themes\Tailwind::class,
went to the path vendor/power-components/livewire-powergrid/src/Themes/Tailwind.php
There, I added this class instead of others eewfewfwef
and everything worked!
What's the problem? Why can't it override the classes that I set in my own theme? Moreover, if I change the theme name, everything crashes with an exception that the theme cannot be found...
Here is what I'm customizing:
public function searchBox(): SearchBox
{
return Theme::searchBox()
->input('eewfewfwef')
->iconClose('text-pg-primary-400 dark:text-pg-primary-200')
->iconSearch('text-pg-primary-300 mr-2 w-5 h-5 dark:text-pg-primary-200');
}
and if it's in my class - nothing happened.
changing to the default theme and customize in the vendor folder - works great
I did everything as in the instructions. Any ideas?
Laravel 10.48 and Last PowerGrids