Bladeren bron

border:none now also becomes border:0 after shorthand generation

Taddeus Kroes 10 jaren geleden
bovenliggende
commit
d262781999
2 gewijzigde bestanden met toevoegingen van 7 en 1 verwijderingen
  1. 1 1
      main.ml
  2. 6 0
      util.ml

+ 1 - 1
main.ml

@@ -151,9 +151,9 @@ let handle_args args =
     (* unfold before pruning duplicates so that shorthand components are
      * correctly pruned *)
     |> switch args.shorthands Shorthand.unfold_stylesheet
-    |> switch args.simple Simple.compress
     |> switch args.duplicates Duplicates.compress
     |> switch args.shorthands Shorthand.compress
+    |> switch args.simple Simple.compress
     |> switch args.sort Util.sort_stylesheet
   in
   let output =

+ 6 - 0
util.ml

@@ -116,6 +116,12 @@ let prerr_loc_msg loc msg =
     | _ -> failwith ("expected " ^ #constructor)
 
 let transform_stylesheet f stylesheet =
+  let f x =
+    match f x with
+    | Expr (Concat [expr] | Nary (_, [expr])) -> Expr expr
+    | value -> value
+  in
+
   let rec trav_expr = function
     | Concat terms -> f (Expr (Concat (trav_all_expr terms)))
     | Function (name, arg) -> f (Expr (Function (name, expect_expr arg)))