Fixes #630 - vendor prefixed flex optimizations.
authorJakub Pawlowicz <contact@jakubpawlowicz.com>
Thu, 30 Jul 2015 08:33:27 +0000 (09:33 +0100)
committerJakub Pawlowicz <contact@jakubpawlowicz.com>
Thu, 6 Aug 2015 08:37:57 +0000 (09:37 +0100)
It's not only flex & flex-basis which should not be optimized but
also their vendor prefixed counterparts.

History.md
lib/selectors/simple.js
test/selectors/simple-test.js

index b43b468..99fd231 100644 (file)
@@ -4,6 +4,11 @@
 * Unifies wrappers for simple & advanced optimizations.
 * Fixed issue [#599](https://github.com/jakubpawlowicz/clean-css/issues/599) - support for inlined source maps.
 
+[3.3.8 / 2015-xx-xx](https://github.com/jakubpawlowicz/clean-css/compare/v3.3.6...3.3)
+==================
+
+* Fixed issue [#630](https://github.com/jakubpawlowicz/clean-css/issues/630) - vendor prefixed flex optimizations.
+
 [3.3.7 / 2015-07-29](https://github.com/jakubpawlowicz/clean-css/compare/v3.3.6...v3.3.7)
 ==================
 
index 87af093..97d2ec4 100644 (file)
@@ -97,7 +97,7 @@ function unitMinifier(name, value, unitsRegexp) {
   if (/^(?:\-moz\-calc|\-webkit\-calc|calc)\(/.test(value))
     return value;
 
-  if (name == 'flex' || name == 'flex-basis')
+  if (name == 'flex' || name == '-ms-flex' || name == '-webkit-flex' || name == 'flex-basis' || name == '-webkit-flex-basis')
     return value;
 
   return value
index ad13745..ee93368 100644 (file)
@@ -517,6 +517,14 @@ vows.describe('simple optimizations')
       'flex–basis': [
         'a{flex-basis:0%}',
         [['flex-basis', '0%']]
+      ],
+      'prefixed flex': [
+        'a{-ms-flex:1 0 0px;-webkit-flex:1 0 0px;}',
+        [['-ms-flex', '1', '0', '0px'], ['-webkit-flex', '1', '0', '0px']]
+      ],
+      'prefixed flex–basis': [
+        'a{-webkit-flex-basis:0px}',
+        [['-webkit-flex-basis', '0px']]
       ]
     })
   )