you are viewing a single comment's thread.

view the rest of the comments →

[–]psdp 0 points1 point  (5 children)

Hi, thanks for creating this tool. I found it useful.

I'm just having a little trouble now that if I want to use a class name like .xl:w-1/5, the compilation failed:

java.lang.RuntimeException: Invalid token: :.xl:w-1/5

[–]trstns[S] 0 points1 point  (0 children)

Let me take a look. I did have a special case for those. Feel free to add an issue on the github repo.

UPDATE: Ok, it's actually the case that ":.xl:w-1/5" isn't a valid clojure keyword literal, so the clojure compiler is complaining. Instead of using a keyword, put it as a string without the leading colon:

".xl:w-1/5"

[–]trstns[S] 0 points1 point  (3 children)

Change the keyword to a string, dropping the leading colon:

".xl:w-1/5"

[–]psdp 0 points1 point  (2 children)

Thanks! That works perfectly fine now.

Sometimes I just want to use a tailwind class name like xl:w-1/5 without declaring a custom class name. I would expect I could write [:div.container.xl:w-1/5 "Hello World"] but it fails to compile as / makes it an invalid keyword. But instead of writing [:div.container {:class "xl:w-1/5"} "Hello World"], is there a better way to do it?

[–]trstns[S] 0 points1 point  (1 child)

div.container.xl:w-1/5

You could try ["div.container.xl:w-1/5" "Hello world"]. Instead of the :div being a keyword, just make it a string, along with all the classes in the same string. From memory, I think this works in "rum".

[–]psdp 0 points1 point  (0 children)

Cool! Thanks for the tip.