-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcssa.js
33 lines (29 loc) · 1009 Bytes
/
cssa.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* global module,require,process */
'use strict';
var cssa = require('../index'),
nomnom = require('nomnom'),
args;
args = nomnom
.script('cssa')
.options({
file: {
position: 0,
help: 'Path to css file to analyze',
list: true
}
})
.parse();
if (args && args.hasOwnProperty('file') && args.file.length > 0) {
cssa.analyzeFile(args.file[0], function(data) {
var key;
console.log('-----------------------------------------');
console.log('file', ':', args.file[0]);
for (key in data) {
console.log(key, ':', data[key]);
}
if (data.selectors >= 4096) {
console.log('You have over 4096 selectors. This file will not work properly in IE9.');
}
console.log('-----------------------------------------');
});
}