},
commaSeparatedMulitpleValues: function (assembleFunction) {
return function(prop, tokens, isImportant) {
- var partsCount = new CommaSplitter(tokens[0].value).split();
+ var tokenSplitLengths = tokens.map(function (token) {
+ return new CommaSplitter(token.value).split().length;
+ });
+ var partsCount = Math.max.apply(Math, tokenSplitLengths);
+
if (partsCount == 1)
return assembleFunction(prop, tokens, isImportant);
var merged = [];
- for (var i = 0; i < partsCount.length; i++) {
+ for (var i = 0; i < partsCount; i++) {
merged.push([]);
for (var j = 0; j < tokens.length; j++) {
- merged[i].push(new CommaSplitter(tokens[j].value).split()[i]);
+ var split = new CommaSplitter(tokens[j].value).split();
+ merged[i].push(split[i] || split[0]);
}
}
--- /dev/null
+.envelope{background:#eee url(one.png) repeat-x top center,#eee url(one.png) repeat-x bottom center,#eee url(two.png) no-repeat 110% 10px;background-size:35px 4px,35px 4px,101px 61px}
--- /dev/null
+.envelope {
+ background: url(one.png), url(one.png), url(two.png);
+ background-color: #eee;
+ background-repeat: repeat-x, repeat-x, no-repeat;
+ background-size: 35px 4px, 35px 4px, 101px 61px;
+ background-position: top center, bottom center, 110% 10px;
+}