Skip to content

HTML->Hiccup conversion producing invalid code #2420

@thheller

Description

@thheller

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugMarks issues describing bugsreleasedMarks issues which have had the fixes released in a stable build

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions