Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

assetgraph-sprite

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

assetgraph-sprite - npm Package Compare versions

Comparing version 0.2.9 to 0.2.10

33

lib/transforms/spriteBackgroundImages.js

@@ -196,7 +196,32 @@ var _ = require('underscore'),

incomingRelation.from.markDirty();
var relationSpriteInfo = AssetGraph.assets.Css.extractInfoFromRule(incomingRelation.cssRule, vendorPrefix + '-sprite-');
var relationSpriteInfo = AssetGraph.assets.Css.extractInfoFromRule(incomingRelation.cssRule, vendorPrefix + '-sprite-'),
offsets = [
imageInfo.x,
imageInfo.y
];
if (incomingRelation.cssRule.style['background-position']) {
// FIXME: Silently ignores other units than px
var positions = incomingRelation.cssRule.style['background-position'].split(' ').map(function (item) {
return parseInt(item, 10);
});
if (positions.length !== 2 || isNaN(positions[0]) || isNaN(positions[1])) {
console.warn(
'WARNING: trying to sprite',
imageInfo.asset.url,
'with background-position:',
incomingRelation.cssRule.style['background-position']
);
} else {
offsets[0] -= positions[0];
offsets[1] -= positions[1];
}
}
incomingRelation.cssRule.style.setProperty('background-position',
(imageInfo.x ? (-imageInfo.x) + "px " : "0 ") +
(imageInfo.y ? -imageInfo.y + "px" : "0"),
relationSpriteInfo.important && 'important');
offsets.map(function (item) {
return item ? -item + 'px' : '0';
}).join(' '),
relationSpriteInfo.important && 'important');
['group', 'padding', 'no-group-selector', 'important'].forEach(function (propertyName) {

@@ -203,0 +228,0 @@ incomingRelation.cssRule.style.removeProperty(vendorPrefix + '-sprite-' + propertyName);

4

package.json

@@ -5,3 +5,3 @@ {

"repository": "git://github.com/One-com/assetgraph-sprite.git",
"version": "0.2.9",
"version": "0.2.10",
"maintainers": [

@@ -26,3 +26,3 @@ {

"assetgraph": "latest",
"vows": ">=0.5.6"
"vows": ">=0.6.2"
},

@@ -29,0 +29,0 @@ "engines": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc