* Fixed issue [#396](https://github.com/jakubpawlowicz/clean-css/issues/396) - better input source maps tracking.
+[3.1.2 / 2015-xx-xx](https://github.com/jakubpawlowicz/clean-css/compare/v3.1.1...3.1)
+==================
+
+* Refixed issue [#471](https://github.com/jakubpawlowicz/clean-css/issues/471) - correct order after restructuring.
+
[3.1.1 / 2015-02-27](https://github.com/jakubpawlowicz/clean-css/compare/v3.1.0...v3.1.1)
==================
}
}
- var position = 0;
- var isCharsetFirst = tokens[0] && tokens[0].kind == 'at-rule' && tokens[0].value.indexOf('@charset') === 0;
- var isCommentFirst = !isCharsetFirst && tokens[0] && tokens[0].kind == 'text' && tokens[0].value.indexOf('__ESCAPED_COMMENT_SPECIAL') === 0;
- var isCommentSecond = isCharsetFirst && tokens[1] && tokens[1].kind == 'text' && tokens[1].value.indexOf('__ESCAPED_COMMENT_SPECIAL') === 0;
-
- if (isCharsetFirst || isCommentFirst)
- position = 1;
- if (isCommentSecond)
- position = 2;
+ var position = tokens[0] && tokens[0].kind == 'at-rule' && tokens[0].value.indexOf('@charset') === 0 ? 1 : 0;
+ for (; position < tokens.length - 1; position++) {
+ if (!tokens[position] || tokens[position].kind != 'text' || tokens[position].value.indexOf('__ESCAPED_COMMENT_SPECIAL') !== 0)
+ break;
+ }
for (i = 0; i < movedProperties.length; i++) {
dropPropertiesAt(position, movedProperties[i]);
'@-moz-keyframes test{0%{transform:scale3d(1,1,1);opacity:1}100%{transform:scale3d(.5,.5,.5);opacity:1}}',
'@-moz-keyframes test{0%{transform:scale3d(1,1,1);opacity:1}100%{transform:scale3d(.5,.5,.5);opacity:1}}'
],
- 'with important comment': [
+ 'with one important comment': [
'__ESCAPED_COMMENT_SPECIAL_CLEAN_CSS0__a{width:100px}div{color:red}.one{display:block}.two{display:inline;color:red}',
'__ESCAPED_COMMENT_SPECIAL_CLEAN_CSS0__.two,div{color:red}a{width:100px}.one{display:block}.two{display:inline}'
],
+ 'with many important comments': [
+ '__ESCAPED_COMMENT_SPECIAL_CLEAN_CSS0____ESCAPED_COMMENT_SPECIAL_CLEAN_CSS1__a{width:100px}div{color:red}.one{display:block}.two{display:inline;color:red}',
+ '__ESCAPED_COMMENT_SPECIAL_CLEAN_CSS0____ESCAPED_COMMENT_SPECIAL_CLEAN_CSS1__.two,div{color:red}a{width:100px}.one{display:block}.two{display:inline}'
+ ],
'with important comment and charset': [
'@charset "utf-8";__ESCAPED_COMMENT_SPECIAL_CLEAN_CSS0__a{width:100px}div{color:red}.one{display:block}.two{display:inline;color:red}',
'@charset "utf-8";__ESCAPED_COMMENT_SPECIAL_CLEAN_CSS0__.two,div{color:red}a{width:100px}.one{display:block}.two{display:inline}'