return token[valueIndex][0][token[valueIndex][0].length - 1] == ')' || token[valueIndex][0].indexOf('__ESCAPED_URL_CLEAN_CSS') === 0;
}
+function afterCalc(token, valueIndex) {
+ return token[valueIndex][0].indexOf('calc(') === 0;
+}
+
function afterComma(token, valueIndex) {
return token[valueIndex][0] == ',';
}
}
function inSpecialContext(token, valueIndex, context) {
- return !context.spaceAfterClosingBrace && afterClosingBrace(token, valueIndex) ||
+ return !context.spaceAfterClosingBrace && afterClosingBrace(token, valueIndex) && !afterCalc(token, valueIndex) ||
beforeSlash(token, valueIndex) ||
afterSlash(token, valueIndex) ||
beforeComma(token, valueIndex) ||
'after hsla': 'a{text-shadow:hsla(240,100%,40%,.5)-1px 1px}',
'inside background': [
'a{background:calc(100% - 2px) 10px no-repeat}',
- 'a{background:calc(100% - 2px)10px no-repeat}'
+ 'a{background:calc(100% - 2px) 10px no-repeat}'
],
'inside background with fraction unit': [
- 'a{background:calc(100% - 2px).5em no-repeat}',
- 'a{background:calc(100% - 2px).5em no-repeat}'
+ 'a{background:calc(100% - 2px) .5em no-repeat}',
+ 'a{background:calc(100% - 2px) .5em no-repeat}'
],
'inside margin': [
'a{margin:calc(100% - 2px) calc(100% - 5px)}',
- 'a{margin:calc(100% - 2px)calc(100% - 5px)}'
+ 'a{margin:calc(100% - 2px) calc(100% - 5px)}'
],
'after :not #1': [
'li:not(.foo).bar{color:red}',
],
'negative padding in calculations': [
'div{padding:calc(100% - 5px) 0 0 0}',
- 'div{padding:calc(100% - 5px)0 0}'
+ 'div{padding:calc(100% - 5px) 0 0}'
]
}),
'floats': cssContext({
'background position': cssContext({
'calc as a value': [
'*{background:white calc(100% - 10px) center no-repeat;background-image:url(test.png)}',
- '*{background:calc(100% - 10px)center no-repeat #fff;background-image:url(test.png)}'
+ '*{background:calc(100% - 10px) center no-repeat #fff;background-image:url(test.png)}'
]
}),
'background-clip': cssContext({