You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I need a button with text-lg and different spacing - I am in trouble. I can just pass text-lg to class and maybe it will actually work sometimes but sometimes it won't (default css priority comes from order of rule definitions which hard to guess in case of TW). Also I can do !text-lg but I need to know in advance that I need override it (so I should keep in head that in case of button component I can use something like margin as is but font-size with important flag only).
So basically in my workflow I am trying to keep my re-usable components to be configured via attributes only. For things like margins I just wrap component with div (or maybe will add spacing attribute in future).
Because of this I would like to have something like
attr:rest,:global,exclude: ~w(class)
Currently I can get something similar with unused class attribute but I would like to have compile-time checks:
attr:class,:stringdefbutton(assigns)doifassigns[:class]doLogger.warn("You should configure button component with attributes instead, class attr ignored.")end...end
How people normally manage this issue with Tailwind (just in case there is some better workflow and I missing it).
The text was updated successfully, but these errors were encountered:
Hello there
I think it would be cool to add some kind of
exclude
for global attributes.Eg with default
button
component:If I need a button with
text-lg
and different spacing - I am in trouble. I can just passtext-lg
toclass
and maybe it will actually work sometimes but sometimes it won't (default css priority comes from order of rule definitions which hard to guess in case of TW). Also I can do!text-lg
but I need to know in advance that I need override it (so I should keep in head that in case ofbutton
component I can use something likemargin
as is butfont-size
with important flag only).So basically in my workflow I am trying to keep my re-usable components to be configured via attributes only. For things like margins I just wrap component with
div
(or maybe will add spacing attribute in future).Because of this I would like to have something like
Currently I can get something similar with unused
class
attribute but I would like to have compile-time checks:How people normally manage this issue with Tailwind (just in case there is some better workflow and I missing it).
The text was updated successfully, but these errors were encountered: