Much like most 3rd party packages that utilize TailwindCSS, classes that are hard-coded within the package are not able to be changed. Yes, we can override or extend the component class itself, but with the existing config already referencing the built-in component files, it would be trivial to add additional array keys to the config for defaultClasses, errorClasses, defaultColorClasses or any other Tailwind options that are needed.
Classes Should Be Configurable
Much like most 3rd party packages that utilize TailwindCSS, classes that are hard-coded within the package are not able to be changed. Yes, we can override or extend the component class itself, but with the existing config already referencing the built-in component files, it would be trivial to add additional array keys to the config for
defaultClasses
,errorClasses
,defaultColorClasses
or any other Tailwind options that are needed.Solution
Here is an example for the Input component.
Config:
Then in the PHP component class:
Additional Context
I have tried this locally by extending the Input component and applying the array keys to the
input
config and it works perfectly.