vincjo / datatables

A toolkit for creating datatable components with Svelte
https://vincjo.fr/datatables
MIT License
426 stars 14 forks source link

[Suggestion] CSS classes on components #29

Closed PercivalFigaro closed 1 year ago

PercivalFigaro commented 1 year ago

Hello!

This was already mentioned in Issue #14, but it would be very helpful if styling could be applied to different components (Pagination, Search, RowsPerPage, ThFilter etc) without remaking all of those components.

The project I'm working on uses the Skeleton UI toolkit. The developers of Skeleton suggested using your datatable as a great replacement to what they are intending to make (since they have not implemented theirs yet), but currently, on a project with a dark background design, this datatable component is very hard to work with - I would have to remake many things from scratch just to change the font color to something readable.

Thanks!

vincjo commented 1 year ago

Hello

Yes no problem if it can be helpful. So basically I added a class prop to each component (thx to @michapixel for suggestion)

<Datatable class="something"/>
<Pagination class="smthg else"/>
<!-- etc. -->

Example: https://vincjo.fr/datatables/test/dark

But I still recommend creating your own components :)

(probably 2-3h of reverse engineering)

PercivalFigaro commented 1 year ago

Thanks a lot!