Does Tailwind CSS natively understand Hiccup? #376
-
I noticed in the tailwind config that the CLJS source directory is directly referenced. So Tailwind actually recognises Hiccup-style class names by default? I'm asking because it would surprise me in that I have seen several other more complicated ways to have Clojure and Tailwind work together (generating HTML from Hiccup, and have Tailwind parse that etc). |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Thanks for your question. I hope i can clarify this a bit. It is important to notice that we reference in
Tailwind works by scanning files specified in config and then going through strings. If you have:
or this hiccup
Then it should work with the current setup - CLJS and shadow-cljs. There is a bit of things you need to take into account the current setup is using shadow-cljs and parsing js files (in cljs-runtime folder, which are js files that already have strings if you use hiccup shorthand syntax), or cljs files. If you think about "regular" hiccup (the one on jvm) your setup might differ. In general i would recommend to make a convention to use the Things to consider:
If there is anything still not clear please let me know and i'll try to clarify further. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the thorough explanation! Personally I am actually using Hiccup both on the client (CLJS) and the backend (no serve-side React, just vanilla static markup generated with Hiccup). It's good to know that Tailwind actually just scans strings for its class names, I was under the impression that it looked for 'class' attributes of some kind (which then makes things more complex). |
Beta Was this translation helpful? Give feedback.
Thanks for your question. I hope i can clarify this a bit. It is important to notice that we reference in
dev
andprod
two different directories as written in the readme:Tailwind works by scanning files specified in config and then going through strings. If you have:
or this hiccup
Then it should work with the current setup - CLJS and shadow-cljs.
There is a bit of things you need to take into account the current setup is using shadow-cljs and parsing js files (in cljs-runtime folder, which are…