Socket
Socket
Sign inDemoInstall

stylecow-plugin-msfilter-background-alpha

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0 to 3.0.0

39

index.js

@@ -6,26 +6,29 @@ var color = require('stylecow-color');

stylecow.addTask({
disable: {
forBrowsersLowerThan: {
explorer: 9.0
},
Declaration: {
background: fixer,
"background-color": fixer
}
});
};
filter: {
type: 'Declaration',
name: ['background', 'background-color']
},
fn: function (declaration) {
var fn = declaration.searchFirst({
type: 'Function',
name: ['rgba', 'hsla']
});
function fixer (declaration) {
var fn = declaration.search({type: 'Function', name: ['rgba', 'hsla']});
if (fn) {
var rgba = color.toRGBA(fn);
if (fn.length === 1) {
var rgba = color.toRGBA(fn[0]);
if (rgba[3] === 1) {
return fn.replaceWith(stylecow.Keyword.createFromString('#' + color.RGBA_HEX(rgba)));
}
if (rgba[3] === 1) {
fn[0].replaceWith(new stylecow.Keyword('#' + color.RGBA_HEX(rgba)));
} else {
var hex = '#' + Math.round(255 * rgba[3]).toString(16) + color.RGBA_HEX(rgba);
var hex = '#' + Math.round(255 * rgba[3]).toString(16) + color.RGBA_HEX(rgba);
var filter = 'progid:DXImageTransform.Microsoft.gradient(startColorStr="' + hex + '", endColorStr="' + hex + '")';
declaration.parent({type: 'Rule'}).addOldMsFilter('progid:DXImageTransform.Microsoft.gradient(startColorStr="' + hex + '", endColorStr="' + hex + '")');
stylecow.utils.addMsFilter(declaration.parent('Block'), filter);
}
}
}
}
});
};
{
"name": "stylecow-plugin-msfilter-background-alpha",
"description": "Stylecow plugin to add ms filters emulating the rgba/hsla colors in backgrounds in explorer < 9 using ms filters.",
"version": "2.0.0",
"version": "3.0.0",
"author": "Oscar Otero <oom@oscarotero.com>",

@@ -14,5 +14,5 @@ "homepage": "https://github.com/stylecow/stylecow-plugin-msfilter-background-alpha",

"dependencies": {
"stylecow-color": "*"
"stylecow-color": "2.*"
},
"license": "MIT"
}
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc