       (forEach elements #(setStyle % color-prop hex-temp)))))
 
 (defn selectors-for-colorize [faces color-type]
-  (let [selectors (map #(face-to-selectors % color-type) faces)]
-    (if (= 1 (count faces))
+  (let [selectors (map #(face-to-selectors % color-type) faces)
+        cnt (count selectors)]
+    (cond
+      (= count 0)
+      [nil nil]
+
+      (= count 1 (count faces))
       (first selectors)
-      (reduce #(vector
+
+      :else (reduce #(vector
                  (str (first %1) "," (first %2))
                  (str (last %1) "," (last %2)))
         selectors))))

        (dom/i #js {:className "fa fa-plus"})))))

(def color-adder (om/factory ColorAdder))

(defn handle-action [comp e]
  (let [{:keys [palette-widget/active-color

      (let [{:keys [bg-faces fg-faces]} face-classes-by-color-type
            color-editable-selector (str ".color-" (:color/id active-color))
            [code-bg-selector face-bg-color-selector] (selectors-for-colorize bg-faces :face/color-bg)
            [code-fg-selector face-fg-color-selector] (selectors-for-colorize fg-faces :face/color-fg)
            bg-selectors  (clojure.string/join "," (remove nil? [color-editable-selector code-bg-selector face-bg-color-selector face-fg-color-selector]))
            fg-selectors   (clojure.string/join "," (remove nil? [code-fg-selector]))]

        (colorize-faces bg-selectors "background-color" hex-temp)
        (colorize-faces fg-selectors "color" hex-temp)))))

(defui PaletteWidget
  static om/IQuery
