Phoenix 1.7 Bootstrap CSS for Core Components

Hello,

When I upgraded to phoenix 1.7, core components with tailwind CSS are now available. Does anyone have rewritten classes for these components in Bootstrap CSS please? I have little experience, I want to use these components, but at the same time I have no idea how to efficiently convert them to Bootsrap CSS.

I knew I couldn’t convert it 1:1, but I was asking for an alternative.

If anyone has a conversion to Bootsrap and shares, I’d appreciate it.

Thank you very much for any help! :slight_smile:

1 Like

It shouldn’t be too difficult, just a bit time consuming.

You could start by converting all the tailwind classes to inline styles. With the exception of a few css variables that’s rather straightforward translation. Then you’d have equivalent functionality but no longer need tailwind dependency.

After that you can migrate to bootstrap at your leisure. See Phoenix 1.7 and Bootstrap 5 - Tutorials and screencasts for Elixir, Phoenix and LiveView for some ideas on this.

1 Like

@John_Shelby Were you able to re-write the co_component.ex into Bootstrap or got someone else’s implementation? If yes, could you kindly share the implementation?

Hello, I have linked to a repo I was using before I migrated from Bootstrap to Flowbite. The repo has core_components.ex with Bootstrap styles. I have striped away the personal stuff so it’s just a bare dashboard template. I have added some simple LiveViews for Product and ProductCategory to see the components in action.
Repo: GitHub - jmnda-dev/phx-bootstrap-dashboard: A Phoenix framework bootstrap dashboard with Bootstrap styles `core_components`

The Modal and some form inputs have some of their styles in the app.scss file. You can follow the ReadMe for setup instructions.
If you have any questions let me know.

2 Likes

Thank you so much. It really helped me.

1 Like