Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML->Hiccup conversion producing invalid code #2420

Closed
thheller opened this issue Aug 24, 2020 · 2 comments
Closed

HTML->Hiccup conversion producing invalid code #2420

thheller opened this issue Aug 24, 2020 · 2 comments
Labels
bug Marks issues describing bugs released Marks issues which have had the fixes released in a stable build
Milestone

Comments

@thheller
Copy link

I have been working on a few projects recently that use tailwind CSS. I usually get HTML/CSS from designers and then port them to Clojure to generate the dynamic versions via hiccup. Unfortunately there are some tailwind classes that break the Cursive HTML->hiccup conversion.

The simplest example being width. w-1/2 being width: 50%. While this is a perfectly valid CSS classname it is not a valid keyword and breaks even worse when using the responsive style

<div class="w-1/2 md:w-1/3 lg:w-1/4">hello world</div>
;; producing
[:div.w-1/2.md:w-1/3.lg:w-1/4 "hello world"]

In general I'd prefer Cursive to always generate [:div {:class "..."}] instead of using the keyword syntax sugar. Would be neat if there was an option to do this.

@cursive-ide cursive-ide added this to the 1.9.4 milestone Aug 27, 2020
@cursive-ide
Copy link
Owner

This is fixed for the next EAP. Classes which aren't valid keywords are always added to the :class attribute, and there's also a new config switch Use shortcuts for class/ID to turn those off altogether.

@thheller
Copy link
Author

Sweet. Thank you.

@cursive-ide cursive-ide modified the milestones: 1.9.4, 1.9.4-eap3 Sep 2, 2020
@cursive-ide cursive-ide added the bug Marks issues describing bugs label Sep 22, 2020
@cursive-ide cursive-ide added the released Marks issues which have had the fixes released in a stable build label Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Marks issues describing bugs released Marks issues which have had the fixes released in a stable build
Projects
None yet
Development

No branches or pull requests

2 participants