Fork me on GitHub

[hoplon/ui "0.2.0-SNAPSHOT"] is on clojars. most significant changes are to the markdown, text, and font apis. fonts are now constructed like this:

(def geometos      (font :system ["Geometos"]      :opentype "geometos.ttf"      :generic :sans-serif))
(def lato-regular  (font :system ["Lato Regular"]  :opentype "lato-regular.ttf"  :generic :sans-serif))
(def lato-italic   (font :system ["Lato Italic"]   :opentype "lato-italic.ttf"   :generic :sans-serif))
(def lato-medium   (font :system ["Lato Medium"]   :opentype "lato-medium.ttf"   :generic :sans-serif))
(def lato-semibold (font :system ["Lato Semibold"] :opentype "lato-semibold.ttf" :generic :sans-serif))
and used like this:
(elem :sh (r 1 1) :ah :mid :t 21 :tf lato-medium
  "hey foo!")
a more detailed explanation can be found in the docstrings:


@jumblerg both docstring are in the wrong place, they should go before the args. 😉 Nice work writing them.


Nice @jumblerg! I am doing some design and will try out today


How can I override an (on) attribute method in an element instance like so:

(defelem myelem [attr] (elem attr :click #(print "foo")))
(myelem :click #(print "bar")
I want to declare default behavior in the defelem but replace/augment that behavior as needed (without necessarily creating a new custom attribute)


@chromalchemy you have to switch where attr is in the elem, like this:

(defelem myelem [attr] (elem :click #(print "foo") attr))
(myelem :click #(print "bar")


because the attributes are evaluated in order i believe so having the argument attrs after the "default" ones will all the defaults to be overridden


That makes sense. More elegant than I expected. Thx!