              (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]


(defn- collect-styles [cls idx styles]
  (let [dynamic (filterv dynamic? styles)
        static (->> styles
                    (filterv (comp not dynamic?))
                    (mapv (fn [[rule value]]
                            [rule
                             (if (number? value)
                               (str value "px")
                               value)])))
        [vars idx]
        (reduce
          (fn [[vars idx] ds]

             (inc idx)])
          [[] idx]
          dynamic)
        vals    (mapv (fn [[_ var] [_ exp]] [var exp]) vars dynamic)
        static  (->> vars
                     (map (fn [[rule var]] [rule (str "var(" var ")")]))
                     (concat static)
                     (build-css cls))]
    [static vals idx]))

(defn build-styles [cls styles]
  (let [pseudo  (filterv pseudo? styles)
        styles  (filterv (comp not pseudo?) styles)
        [static vals idx] (collect-styles cls 0 styles)
        pstyles (->> pseudo
                     (map (fn [[rule styles]]
                            (collect-styles (str cls (subs (name rule) 1)) idx styles))))
        static  (->> pstyles
                     (map first)
                     (apply str)
                     (str static))
        vals    (->> pstyles
                     (mapcat second)
                     (into vals))]
    [static vals]))

(defn- ->status-styles [styles]
