This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-12
Channels
- # arachne (1)
- # beginners (26)
- # cljs-dev (53)
- # cljsrn (1)
- # clojure (140)
- # clojure-italy (13)
- # clojure-russia (14)
- # clojure-spec (5)
- # clojure-uk (6)
- # clojurescript (52)
- # datascript (4)
- # datomic (11)
- # dirac (11)
- # emacs (12)
- # hoplon (9)
- # jobs (4)
- # lein-figwheel (1)
- # off-topic (29)
- # om (10)
- # om-next (1)
- # pedestal (3)
- # protorepl (1)
- # re-frame (16)
- # ring (12)
- # rum (27)
- # slack-help (12)
- # spacemacs (27)
- # unrepl (19)
- # untangled (26)
- # yada (8)
[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:
https://github.com/hoplon/ui/blob/master/lib/src/hoplon/ui/attrs.cljs#L382-L481
https://github.com/hoplon/ui/blob/master/lib/src/hoplon/ui.cljs#L272-L342 @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!