tokens = [tokens];
}
+ var result = '';
+
// This step takes care of putting together the components of shorthands
// NOTE: this is necessary to do for every shorthand, otherwise we couldn't remove their default values
for (var i = 0; i < tokens.length; i++) {
Array.prototype.splice.apply(tokens, [i, 1].concat(news));
t.isDirty = false;
i--;
+ continue;
}
- }
- // And now, simply map every token into its string representation and concat them with a semicolon
- var str = tokens.map(function(token) {
- var result = '';
+ if (t.prop)
+ result += t.prop + ':';
- // NOTE: malformed tokens will not have a 'prop' property
- if (token.prop) {
- result += token.prop + ':';
- }
- if (token.value) {
- result += token.value;
- }
- if (token.isImportant) {
+ if (t.value)
+ result += t.value;
+
+ if (t.isImportant)
result += important;
- }
- return result;
- }).join(';');
+ result += ';';
+ }
- return str;
+ return result.substr(0, result.length - 1);
};
// Gets the final (detokenized) length of the given tokens