Customizing Section Classes

Hello - does anyone know how to remove the gap-6 from the default Section view? I've tried ->extraAttributes(['class' => 'gap-0']) but it has no effect. The gap-6 overrides it. I've tried using !important but that didn't work either. I'm trying to avoid publishing the view and removing it completely - I only need to remove the gap from one specific section. Thank you!
No description
Solution:
So just target the appropriate Div in a custom theme. Use extraAttributes to add a class then target the class in css with a custom theme.
Jump to solution
8 Replies
awcodes
awcodes2mo ago
Gap-0 is probably not in the filament default stylesheet. Any time you want to override you will need a custom theme. It’s just how tailwind works. https://filamentphp.com/docs/3.x/panels/themes#creating-a-custom-theme
bwurtz999
bwurtz9992mo ago
It looks like it has something to do with the way the div is created
bwurtz999
bwurtz9992mo ago
No description
awcodes
awcodes2mo ago
Gap doesn’t work with block only flex or grid. But it sounds like something else might be causing issues. I’m pretty sure section uses grid, not block.
bwurtz999
bwurtz9992mo ago
No description
bwurtz999
bwurtz9992mo ago
The default gap-6 is applied later to a div that uses grid. The extraAttributes go to a different div
No description
Solution
awcodes
awcodes2mo ago
So just target the appropriate Div in a custom theme. Use extraAttributes to add a class then target the class in css with a custom theme.
bwurtz999
bwurtz9992mo ago
Thank you!
Want results from more Discord servers?
Add your server