From 57ce22071a4b88f6576431fcd813fbdb68f2de92 Mon Sep 17 00:00:00 2001 From: Jakub Pawlowicz Date: Thu, 30 Jul 2015 09:33:27 +0100 Subject: [PATCH] Fixes #630 - vendor prefixed flex optimizations. It's not only flex & flex-basis which should not be optimized but also their vendor prefixed counterparts. --- History.md | 5 +++++ lib/selectors/simple.js | 2 +- test/selectors/simple-test.js | 8 ++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/History.md b/History.md index b43b4682..99fd231a 100644 --- a/History.md +++ b/History.md @@ -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) ================== diff --git a/lib/selectors/simple.js b/lib/selectors/simple.js index 87af093d..97d2ec41 100644 --- a/lib/selectors/simple.js +++ b/lib/selectors/simple.js @@ -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 diff --git a/test/selectors/simple-test.js b/test/selectors/simple-test.js index ad13745d..ee93368a 100644 --- a/test/selectors/simple-test.js +++ b/test/selectors/simple-test.js @@ -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']] ] }) ) -- 2.34.1