              (inc idx)])
           [[] idx]
           dynamic)
-        vals (mapv (fn [[_ var] [_ exp]] [(str "var(" var ")") exp]) vars dynamic)
-        static (->> vars
-                    (map (fn [[rule var]] [rule (str "var(" var ")")]))
-                    (concat static)
-                    (map (fn [[rule val]] (str (name rule) ":" (escape-val rule val) ";")))
-                    (cstr/join "")
-                    (#(str "{" % "}")))]
+        vals    (mapv (fn [[_ var] [_ exp]] [(str "var(" var ")") exp]) vars dynamic)
+        static  (->> vars
+                     (map (fn [[rule var]] [rule (str "var(" var ")")]))
+                     (concat static)
+                     (map (fn [[rule val]] (str (name rule) ":" (escape-val rule val) ";")))
+                     (cstr/join "")
+                     (#(str "{" % "}")))]
     [static vals idx]))
 
 (defn- ->ks-key [k]

         (group-by first)
         (map (fn [[rule states]]
                (let [svals (map last states)
                      args (mapv (fn [_] (gensym "var")) svals)]
                  [rule
                   `(with-meta
                      (fn ~args


(defn- collect-styles [cls idx styles]
  (let [dynamic (filterv dynamic? styles)
        static  (filterv (comp not dynamic?) styles)
        [vars idx]
        (reduce
          (fn [[vars idx] ds]
