Modal submit action button is white text on white background - I can't figure out how to change that
I may have done something wrong but I haven't yet customized any CSS in this application - I can't figure out why my modal button is showing this way.
This is the code:
I know that using
modalSubmitAction
is overriding my modalSubmitActionLabel
, I've just been trying several different things. I also know that I can use css to fix the button, but I can't help but think I've just done something wrong in my setup.
I'm attaching screenshots of the button (one normal, one after selecting all text)Solution:Jump to solution
If you’re not in a panel then you will need to follow the forms installation instructions to setup up tailwind correctly and load the appropriate filament directives in you layout.
14 Replies
->color('danger')
That does not fix the issue, but it leads me to believe I have a configuration issue. I see the style being applied to the element:
I've tried one of the default colors as well, stone
In other places of the app, the primary color is used - is maybe the styles not being loaded in the modal?
danger is default also. Did you customize something?
It's possible, but I haven't worked on this app in awhile until this week. I think it's mostly stock. I even tried to add a custom color to my tailwind.config.css:
That broke things with this error:
[vite] Internal server error: [postcss] /app/resources/css/app.css:1:1: 'colors.gray.400' does not exist in your theme config. 'colors' has the following keys: 'red'Which makes me think it's a stock configuration
hum no, you should do this:
https://filamentphp.com/docs/3.x/support/colors#customizing-the-default-colors
I don't want to customize the colors - I just wanted to see what would happen if I did (I'm just learning how these work, really)
in this case, are you using panel builder or is it a custom LW component?
It is a LW component:
Barcode scanner wrapper is just a way to display my livewire component in the modal
Something is telling me that I've botched this up, though.
I would expect this code to be executed when either the submit or cancel button on the modal is clicked: However, it is executed when I click "Scan items", i.e. the element that opens the modal - both the submit and cancel In other words, I'm wondering if the color is just a symptom of a larger issue I'm having with setting this up
I would expect this code to be executed when either the submit or cancel button on the modal is clicked: However, it is executed when I click "Scan items", i.e. the element that opens the modal - both the submit and cancel In other words, I'm wondering if the color is just a symptom of a larger issue I'm having with setting this up
if you are using this inside the panel builder, this should show the default filament colors,
primary
, danger
, etc..You're right - I added the action to an existing Resource that I have, OrderResource, and the color is correct. I'll have to just make this work and then come back to why it wasn't working in a custom LW component. Thank you for your help!
Solution
If you’re not in a panel then you will need to follow the forms installation instructions to setup up tailwind correctly and load the appropriate filament directives in you layout.
Ah! Thanks @awcodes - that did it :). I was missing
@filamentStyles
and @filamentScripts