Override the library styles by className (Tailwind CSS) #40
Replies: 6 comments 12 replies
-
Yes, I can add additional className some 'active' if I wanna mark row. And describe styles for this className in useTheme. But I think it looks like a crutch, and it can be greatly simplified. |
Beta Was this translation helpful? Give feedback.
-
Can you give an example of how this should look like in code? |
Beta Was this translation helpful? Give feedback.
-
It turns out that there is no way around the inline style taking precedence in the library unfortunately. However, I read more about Tailwind and how you can define
With version
Would this help in your case? |
Beta Was this translation helpful? Give feedback.
-
Absolutely not. I'm shopping a react table and found yours. important: true
worked for me.
If emotion were completely option that would be great, but I just can thank
you for the effort you put into this library.
Looking forward using it.
Em ter., 14 de jun. de 2022 às 04:56, Robin Wieruch <
***@***.***> escreveu:
… @geraldodev <https://github.com/geraldodev> does the shown example not
work for you? If not: How would an ideal API look like instead?
—
Reply to this email directly, view it on GitHub
<#40 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAF5CCALEIAOZ4PQE6GDDOTVPA3MNANCNFSM5S4QFP4A>
.
You are receiving this because you were mentioned.Message ID:
<table-library/react-table-library/repo-discussions/40/comments/2944756@
github.com>
|
Beta Was this translation helpful? Give feedback.
-
The proposed solution of defining important at the table level is not working for me. I am using Remix (https://remix.run/) and when I define important, run
When I add a tailwind class to an element
Edit: The tailwind class is applied to the Row element, but the remainder of the tailwind styles across my app are still not being applied. |
Beta Was this translation helpful? Give feedback.
-
I've been trying for a while and the only thing I've found is to use "!" before tailwind css class. and well try to use the table themes by hand to match tailwind ones. import * as ReactTable from "@table-library/react-table-library/table";
return (
<div>
<ReactTable.HeaderRow className="!bg-blue-200 sm:hover:!tw-font-bold">
<ReactTable.HeaderCell>Título</ReactTable.HeaderCell>
<ReactTable.HeaderCell>Artista</ReactTable.HeaderCell>
<ReactTable.HeaderCell>Album</ReactTable.HeaderCell>
<ReactTable.HeaderCell>Archivo</ReactTable.HeaderCell>
</ReactTable.HeaderRow>
</div>
); If I find a very abstract solution for the Themes I will share it with you. |
Beta Was this translation helpful? Give feedback.
-
Please add the ability to override the styles of ALL library components, now the built-in className overrides the custom one.
I have a need to dynamically define a background for EACH row. But the component:
I don't like to use style prop. And I really want my className to override the library styles. I think it's not difficult to do and will bring a lot of joy!
Beta Was this translation helpful? Give feedback.
All reactions