See discussion in #325.
+[2.2.12 / 2014-xx-xx](https://github.com/GoalSmashers/clean-css/compare/v2.2.11...v2.2.12)
+==================
+
+* Fixed issue with tokenizer removing first selector after an unknown @ rule.
+
[2.2.11 / 2014-07-28](https://github.com/GoalSmashers/clean-css/compare/v2.2.10...v2.2.11)
==================
var oldMode;
if (what == 'special') {
- var fragment = chunk.substring(nextSpecial, context.cursor + '@font-face'.length + 1);
- var isSingle = fragment.indexOf('@import') === 0 || fragment.indexOf('@charset') === 0;
+ var firstOpenBraceAt = chunk.indexOf('{', nextSpecial);
+ var firstSemicolonAt = chunk.indexOf(';', nextSpecial);
+ var isSingle = firstSemicolonAt > -1 && (firstOpenBraceAt == -1 || firstSemicolonAt < firstOpenBraceAt);
if (isSingle) {
nextEnd = chunk.indexOf(';', nextSpecial + 1);
tokenized.push(chunk.substring(context.cursor, nextEnd + 1));
'merging color with backgrounds': [
'p{background:red;background-image:url(1.png),url(2.png)}',
'p{background:url(1.png),url(2.png) red}'
- ]
+ ],
+ 'unknown @ rule': '@unknown "test";h1{color:red}'
}),
'viewport units': cssContext({
'shorthand margin with viewport width not changed': 'div{margin:5vw}'