I want to create CSS style using hiccup by specifying the "top" and "left" variables to position an element. Currently, my code looks like this:
(html [:div {:style (str "top" top ";left" left)} "some text"])
The code above is not very clean. It would be more convenient if hiccup could automatically generate the "style" attribute using standard CSS rules. In that case, I could rewrite the code as follows:
(html [:div {:style {:top top :left left}} "some text"])
Is there a library available that can handle this task? Or do I need to create my own solution?
Any advice from Clojurians would be greatly appreciated!