File tree Expand file tree Collapse file tree 1 file changed +21
-14
lines changed
Expand file tree Collapse file tree 1 file changed +21
-14
lines changed Original file line number Diff line number Diff line change 838838 (lvalue [p])
839839 (rvalue [p]))
840840
841+ #?(:clj
842+ (deftype CSSProperty [prop-name default ]
843+ CSSProp
844+ (lvalue [_] (str " --" (name prop-name)))
845+ (rvalue [_] (str " var(--" (name prop-name) " )" ))
846+ gu /ToString
847+ (to-str [this]
848+ (str " --" (name prop-name)))
849+ Object
850+ (toString [_] (str " var(--" (name prop-name) " )" ))
851+ clojure.lang.ILookup
852+ (valAt [this kw] (when (= :default kw) default ))
853+ (valAt [this kw fallback] (if (= :default kw) default fallback))
854+ clojure.lang.IMeta
855+ (meta [this] {:type ::prop }))
856+ )
857+
841858(defn css-prop [prop-name default ]
842859 #? (:clj
843- (with-meta
844- (reify
845- CSSProp
846- (lvalue [_] (str " --" (name prop-name)))
847- (rvalue [_] (str " var(--" (name prop-name) " )" ))
848- gu/ToString
849- (to-str [this]
850- (str " --" (name prop-name)))
851- Object
852- (toString [_] (str " var(--" (name prop-name) " )" ))
853- clojure.lang.ILookup
854- (valAt [this kw] (when (= :default kw) default ))
855- (valAt [this kw fallback] (if (= :default kw) default fallback)))
856- {:type ::prop })
860+ (->CSSProperty prop-name default )
857861 :cljs
858862 (with-meta
859863 (reify
870874
871875#?(:clj
872876 (defmethod print-method ::prop [p writer]
877+ (.write writer (lvalue p)))
878+
879+ (defmethod print-dup CssProperty [p writer]
873880 (.write writer (lvalue p))))
874881
875882#?(:clj
You can’t perform that action at this time.
0 commit comments