laravel-datatables icon indicating copy to clipboard operation
laravel-datatables copied to clipboard

TailwindCSS support

Open rootuser opened this issue 1 year ago • 5 comments

Hello,

no problem but a feature request: I am a fan of this project, but I tend to not use Bootstrap anymore in favour of TailwindCSS. Now I see there is a tech preview for TailwindCss support in datatables.net, see https://datatables.net/examples/styling/tailwind.html

Can you please add support for this? I guess you would have to adapt laravel-datatables-vite to load different packages, and the crux is that these files are not yet available through composer, I suppose. But maybe the developer of datatables, Allan, is willing to help.

Thank you!

Kind regards, Tom

rootuser avatar Aug 10 '23 13:08 rootuser

Thanks for the heads up! I'm also looking forward to the official TailwindCSS support along with the Editor. Had rough days way back implementing my own version of it.

I was planning to publish it at https://github.com/yajra/datatables.net-tailwindcss but didn't push through with it ^_^

DataTables

image

Editor

image

Anyways, I will try to have something setup for the official version once it's out of Tech Preview I guess.

yajra avatar Aug 11 '23 05:08 yajra

Hello,

thanks for your reply!

I should point you to a forum thread that I found yesterday after writing this post here: https://datatables.net/forums/discussion/comment/222861/#Comment_222861 It is a comment of Allan regarding the Tailwind integration.

Regarding your 'homebrew' implementation: yes, I've been wondering if I could do this myself too, but it's easy to get lost in the details when you're developing; you don't just need tables for an app, and you simply can not be building all the pieces yourself as long as you're not part of a big team.

So basically I was just looking for a good implementation of tables for Laravel, and there are one or two candidates, but I've known datatables.net for a long time now and that makes it more attractive. The only drawbacks are the dependancies.

I also dearly wish to use Tailwind, because I found Flowbite, which is, simply put, a free collection of GUI components in TailwindCSS. Have a look here: https://flowbite.com/docs/components/tables/ I'd love to have datatables in the Flowbite design... ;-) Perhaps you like it, too.

By the way, there's one more question I'd like to ask you. I'm relatively new to the Laravel ecosystem, so please don't be surprised if I ask for something obvious: in your quickstart guide you are intalling laravel/ui. What exactly does this do? Is this only necessary for Bootstrap integration?

Anyway, thanks for your positive response! I would be very happy if datatables would work with Tailwind someday!

rootuser avatar Aug 11 '23 07:08 rootuser

Thanks for the thread, I am also following and aware of it.

quickstart guide you are intalling laravel/ui

Yes, added for quick bootstrap setup with Laravel Mix if I recall correctly.

yajra avatar Aug 11 '23 08:08 yajra

I also dearly wish to use Tailwind, because I found Flowbite

Yes, I also played with this some time ago. Will re-think my tailwindCss support when I got the chance. Flowbite is also my latest choice to follow for styles if I'm going to support this.

yajra avatar Aug 11 '23 08:08 yajra

I finally had the chance to play with tailwindcss again, see https://github.com/yajra/laravel-datatables-tailwind-experiment.

Integration script https://github.com/yajra/laravel-datatables-tailwind-experiment/blob/main/resources/js/dataTables.tailwindcss.js

yajra avatar May 09 '24 01:05 yajra