protonemedia / laravel-form-components

A set of Blade components to rapidly build forms with Tailwind CSS (v1.0 and v2.0) and Bootstrap 4/5. Supports validation, model binding, default values, translations, Laravel Livewire, includes default vendor styling and fully customizable!
https://protone.media/blog/laravel-form-components-to-rapidly-build-forms-with-tailwind-css-and-bootstrap-4
MIT License
815 stars 103 forks source link

Feature: Changing framework or multiple frameworks #77

Open wenfei-huang opened 2 years ago

wenfei-huang commented 2 years ago

My site uses tailwind and bootstrap. Is it possible to use multiple frameworks?

For example on bootstrap4_index.blade.php I declare to use framework bootstrap 4 and on tailwind_index.blade.php I declare to use tailwind framework. Or using prefixes with a framework, where you can set a prefix bound to a framework? For example and

mrl22 commented 2 years ago

I believe tailwind and bootstrap conflict on CSS styles, I would advise against loading them both.

Patabugen commented 2 years ago

I've got Bootstrap on the back end, but Tailwind on the front end - is there a way to specify on a per-form basis which framework to use?

For example:

@template('tailwind');

@endtemplate

Or perhaps a @config blade directive?

Workaround

I'm not mixing and matching templates, but using different ones on different overall layouts - so as a workaround I'm able to set the framework config in my controllers as-required.

config(['form-components.framework' => 'tailwind']);

I would second what @mrl22 says - having Tailwind and Bootstrap on the same page is probably not the path to happiness!