tailwind-clj
tailwind-clj copied to clipboard
Amazing idea
I love the idea of this project!
Tailwind css files are always very big (2mb full set, 4mb full set with dark and light theme) and the time it takes the browser to process that is In the second(s) range.
I see two ways of using this library:
-
Define a list of tags combinations that I want and Generate a css file. This is similar to the tailwind css generation tools, but compleyely clojure based.
-
Use the macro to generate css at runtime. If this is used with server rendered pages then this Will work fine I guess. I have a reagent app with lots Of components that may or may not be used on a Page. So for that I would need a css register that Changes dynamically the css tags that are shown based On different components used.
My question is: is this project up to date with the Latest tailwind version?
Thanks
Yeah so I wrote this code prior to tailwind 1.0 when I was experimenting with css utility classes. Tailwind actually uses the same method now of only generating css for the classes it finds in the content (JIT mode).
The difference is that the official tooling uses a regex over all source content to discover the classes (which does work for the most part for clojurescript source content). With clojurescript however you can do it at compile time with macros.
My question is: is this project up to date with the Latest tailwind version?
No. Tailwind project has evolved a LOT. I more or less used tailwind 1.0 as inspiration to design the core.match rules in transform.clj but haven't had the need or time to update. If you want the latest and greatest tailwind experience I'd just use the official tooling it's great. If you really want clojure-only tooling with the latest tailwind classes it'd be a fair bit of work to update the core.match rules
The approach of macros is amazing. This way I could write teageny components that use taikwind utility classes, and the entire needed css could be auto generated in the browser.
My other usecase is even more dynamic: I run clojurescript scripts that generate pages in the browser. Not having to load the entire tailwind css really would speed it up.
I really want to get this done at some point. But right now I have to focus to build proper ui components in clojurescript with tailwind.