forked from jquery-archive/css-chassis
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes jquery-archive#99
- Loading branch information
Showing
8 changed files
with
108 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ external/ | |
icons/svg-min/ | ||
.sass-cache/ | ||
dist/ | ||
tmp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
module.exports = function( grunt ) { | ||
var path = require( "path" ); | ||
require( "load-grunt-config" )( grunt, { | ||
configPath: [ | ||
path.join( process.cwd(), "tasks/options" ), | ||
path.join( process.cwd(), "tasks" ) | ||
], | ||
init: true | ||
} ); | ||
grunt.loadNpmTasks("axe-grunt-webdriver"); | ||
var path = require( "path" ); | ||
require( "load-grunt-config" )( grunt, { | ||
configPath: [ | ||
path.join( process.cwd(), "tasks/options" ), | ||
path.join( process.cwd(), "tasks" ) | ||
], | ||
init: true | ||
} ); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<!doctype html> | ||
<html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>CSS Chassis - Typography</title> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
|
||
|
||
function color(code, str) { | ||
return "\u001b[" + code + "m" + str + "\u001b[0m"; | ||
} | ||
|
||
exports = module.exports = function( grunt, results, threshold ) { | ||
var pass = true; | ||
results.forEach( function ( result ) { | ||
grunt.log.subhead( result.url ); | ||
var violations = result.violations; | ||
if ( violations.length ) { | ||
if ( violations.length > threshold ) { | ||
pass = false; | ||
grunt.log.error( "Found " + result.violations.length + " accessibility violations:" ); | ||
} else { | ||
grunt.log.ok( "Found " + result.violations.length + " accessibility violations: (under threshold of " + threshold + ")" ); | ||
} | ||
result.violations.forEach( function( ruleResult ) { | ||
grunt.log.subhead( " " + color(31, "\u00D7") + " " + ruleResult.help ); | ||
|
||
ruleResult.nodes.forEach( function( violation, index ) { | ||
grunt.log.writeln( " " + ( index + 1 ) + ". " + JSON.stringify( violation.target ) ); | ||
|
||
if ( violation.any.length ) { | ||
grunt.log.writeln( " Fix any of the following:" ); | ||
violation.any.forEach( function( check ) { | ||
grunt.log.writeln( " \u2022 " + check.message ); | ||
} ); | ||
} | ||
|
||
var alls = violation.all.concat( violation.none ); | ||
if ( alls.length ) { | ||
grunt.log.writeln( " Fix all of the following:" ); | ||
alls.forEach( function( check ) { | ||
grunt.log.writeln( " \u2022 " + check.message ); | ||
} ); | ||
} | ||
grunt.log.writeln(); | ||
}); | ||
}); | ||
return; | ||
} else { | ||
grunt.log.ok( "Found no accessibility violations." ); | ||
} | ||
} ); | ||
return pass; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module.exports = { | ||
firefox: { | ||
options: { | ||
threshold: 0 | ||
}, | ||
urls: ['http://localhost:4200/demos/typography.html'], | ||
dest: 'tmp/gu.json' | ||
}, | ||
chrome: { | ||
options: { | ||
browser: 'chrome', | ||
threshold: 0 | ||
}, | ||
urls: ['http://localhost:4200/demos/typography.html'] | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters