diff --git a/lib/map-over-styles-and-transform-background-image-declarations.js b/lib/map-over-styles-and-transform-background-image-declarations.js index de1560a..ff6d8a8 100644 --- a/lib/map-over-styles-and-transform-background-image-declarations.js +++ b/lib/map-over-styles-and-transform-background-image-declarations.js @@ -39,6 +39,11 @@ function mapOverStylesAndTransformAllBackgroundImageDeclarations(styles, cb) { var transformedDeclaration = extend(true, {}, declaration); transformedDeclaration = attachInfoToDeclaration(declarations, declarationIndex); + // only add backgroud image with the '?__spriter' suffix + var declarationValue = transformedDeclaration.value; + + if (/\?__spriter/i.test(declarationValue)) { + transformedDeclaration.value = declarationValue.replace('?__spriter', ''); // background-image always has a url if(transformedDeclaration.property === 'background-image') { return cb(transformedDeclaration, declarationIndex, declarations); @@ -51,6 +56,7 @@ function mapOverStylesAndTransformAllBackgroundImageDeclarations(styles, cb) { return cb(transformedDeclaration, declarationIndex, declarations); } } + } // Wrap in an object so that the declaration doesn't get interpreted return {