Namespaces

 
1.0.0-SNAPSHOT permalink Arrow_down_16x16

remove-class

net.cgrand.enlive-html

  • (remove-class & classes)
Removes the specified classes from the selected element.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source net/cgrand/enlive_html.clj:641 top

(defn remove-class 
 "Removes the specified classes from the selected element." 
 [& classes]
  #(let [classes (when-let [cl (attr-values % :class)] 
                   (reduce disj cl classes)) 
         attrs (:attrs %)
         attrs (if (empty? classes) 
                 (dissoc attrs :class) 
                 (assoc attrs :class (apply str (interpose \space classes))))]
     (assoc % :attrs attrs)))
Vars in net.cgrand.enlive-html/remove-class: assoc defn let
Used in 0 other vars

Comments top

No comments for remove-class. Log in to add a comment.