* Fixed issue [#186](https://github.com/GoalSmashers/clean-css/issues/186) - strip unit from 0rem.
* Fixed issue [#207](https://github.com/GoalSmashers/clean-css/issues/207) - bug in parsing protocol `@import`s.
+[2.0.7 / 2014-xx-xx (UNRELEASED)](https://github.com/GoalSmashers/clean-css/compare/v2.0.6...v2.0.7)
+==================
+
+* Fixed issue [#208](https://github.com/GoalSmashers/clean-css/issues/208) - don't swallow @page and @viewport.
+
[2.0.6 / 2014-01-04](https://github.com/GoalSmashers/clean-css/compare/v2.0.5...v2.0.6)
==================
module.exports = function Tokenizer(data, minifyContext) {
var chunker = new Chunker(data, 128);
var chunk = chunker.next();
+ var flatBlock = /^@(font\-face|page|\-ms\-viewport|\-o\-viewport|viewport)/;
var whatsNext = function(context) {
var cursor = context.cursor;
nextEnd = chunk.indexOf('{', nextSpecial + 1);
var block = chunk.substring(context.cursor, nextEnd).trim();
- var isFlat = fragment.indexOf('@font-face') === 0;
+ var isFlat = flatBlock.test(block);
oldMode = context.mode;
context.cursor = nextEnd + 1;
context.mode = isFlat ? 'body' : 'block';
'a{border-top:1px solid red;border-top-color:#0f0;color:red;border-top-width:2px;border-bottom-width:1px;border:0;border-left:1px solid red}',
'a{color:red;border:0;border-left:1px solid red}'
]
+ }),
+ 'grouping with advanced optimizations': cssContext({
+ '@-moz-document': '@-moz-document domain(mozilla.org){a{color:red}}',
+ '@media': '@media{a{color:red}}',
+ '@page': '@page{margin:.5em}',
+ '@supports': '@supports (display:flexbox){.flex{display:flexbox}}',
+ '@-ms-viewport': '@-ms-viewport{width:device-width}',
+ '@-o-viewport': '@-o-viewport{width:device-width}',
+ '@viewport': '@viewport{width:device-width}'
})
}).export(module);