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

arialinter

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arialinter - npm Package Compare versions

Comparing version 0.2.6 to 0.2.7

34

lib/rules/distinguishable.js

@@ -24,16 +24,24 @@ // Guideline 1.4 Distinguishable

var getInheritedColor = function(dom, that, property) {
dom.$(that).parents().each( function() {
var bc = dom.$(this).css('background-color');
if (bc === 'transparent') {
return getInheritedColor(dom, this, property);
} else {
return bc;
}
});
var getInheritedProperty = function(e, property) {
// Is current element's background color set?
var color = e.css(property);
if ((color !== 'rgba(0, 0, 0, 0)') && (color !== 'transparent')) {
// if so then return that color
return color;
}
// if not: are you at the body element?
if (e.is('body')) {
// return known 'false' value
return false;
} else {
// call getBackground with parent item
return getInheritedProperty(e.parent(), property);
}
};
dom.$('h1').each(function() {
var bg = new Color(dom.$(this).parent().css('background-color'));
var fg = new Color(dom.$(this).css('color'));
var bg = new Color(getInheritedProperty(dom.$(this), 'background-color'));
var fg = new Color(getInheritedProperty(dom.$(this), 'color'));

@@ -44,5 +52,7 @@ var L1 = bg.luminosity();

var ratio = Math.round((Math.max(L1, L2) + 0.05)/(Math.min(L1, L2) + 0.05)*10)/10;
console.log('Ratio: ' + ratio);
if (ratio <= 3) {
reporter.error(that.message, 0, that.name);
reporter.info(that.message, 0, that.name);

@@ -49,0 +59,0 @@ throw dom.$(this).parent().html();

{
"name": "arialinter",
"description": "AriaLinter provides a simple accesibility linter for HTML documents.",
"version": "0.2.6",
"version": "0.2.7",
"homepage": "https://github.com/globant-ui/arialinter",

@@ -6,0 +6,0 @@ "repository": {

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