Builds client SSR approach, sunsets old cljs.
This commit is contained in:
@@ -34,15 +34,14 @@
|
||||
(remove-wildcard [this wildcard]
|
||||
(if (sequential? wildcard)
|
||||
(reduce
|
||||
remove-wildcard
|
||||
this
|
||||
wildcard)
|
||||
remove-wildcard
|
||||
this
|
||||
wildcard)
|
||||
(reduce
|
||||
remove-class
|
||||
this
|
||||
(filter (fn [c]
|
||||
(str/starts-with? c wildcard)
|
||||
) @class-set)))
|
||||
remove-class
|
||||
this
|
||||
(filter (fn [c]
|
||||
(str/starts-with? c wildcard)) @class-set)))
|
||||
this)
|
||||
(replace-wildcard [this wildcard add]
|
||||
(remove-wildcard this wildcard)
|
||||
@@ -51,7 +50,7 @@
|
||||
(replace-tw [this add]
|
||||
;; TODO
|
||||
)
|
||||
Object
|
||||
Object
|
||||
(toString [this]
|
||||
(str/join " " @class-set)))))
|
||||
|
||||
@@ -60,8 +59,7 @@
|
||||
(add-class [this add]
|
||||
(add-class (string->class-list this) add))
|
||||
(remove-class [this remove]
|
||||
(remove-class (string->class-list this) remove)
|
||||
)
|
||||
(remove-class (string->class-list this) remove))
|
||||
(replace-class [this remove add]
|
||||
(replace-class (string->class-list this) remove add))
|
||||
(remove-wildcard [this wildcard]
|
||||
@@ -70,29 +68,11 @@
|
||||
(replace-wildcard (string->class-list this) wildcard add))
|
||||
(add-tw [this tw]
|
||||
(replace-tw (string->class-list this)
|
||||
tw)
|
||||
))
|
||||
tw)))
|
||||
|
||||
|
||||
(str (hiccup/html [:div {:class (-> "hello bryce hello-1 hello-2"
|
||||
(replace-wildcard ["hello-" "b"] ["hi" "there"]))}]))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
(str (hiccup/html [:div {:class (-> "p-1.5 "
|
||||
(add-class "bg-blue-500")
|
||||
#_(replace-wildcard ["hello-" "b"] ["hi" "there"]))}]))
|
||||
|
||||
Reference in New Issue
Block a user