ucss
ucss copied to clipboard
Bug or outdated docs?
I'm following your README:
// css can be an array of strings, file paths, or URLs
var css = [".foo {} .bar {} .baz {}"];
// html can be an array of strings, file paths, or URLs
var html = ["<html><head></head><body class='foo'></body></html>"];
var context = {
whitelist: [".baz"], // CSS selectors to ignore
auth: null, // For login (please se example elsewhere)
timeout: 400 // Request timeout (defaults to 400ms)
};
var logger = null; // Function for logging HTTP requests
// Do the magic
ucss.analyze(html, css, context, logger, function(result) {
// Do something to the result object
console.log(result);
});
When I run this, I get:
> node index.js
{
selectors: {
'.foo': {
ignored: false,
whitelisted: false,
matches_html: 0,
matches_uris: [],
occurences_css: 1,
pos_css: [Object]
},
'.bar': {
ignored: false,
whitelisted: false,
matches_html: 0,
matches_uris: [],
occurences_css: 1,
pos_css: [Object]
},
'.baz': {
ignored: false,
whitelisted: true,
matches_html: 0,
matches_uris: [],
occurences_css: 1,
pos_css: [Object]
}
},
total: 3,
total_used: 0,
total_unused: 2,
total_duplicates: 0,
total_ignored: 1,
load_errors: []
}
This doesn't seem correct. Shouldn't there be 1 used?