Skip to content

Instantly share code, notes, and snippets.

@jtfell
Last active November 8, 2016 08:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtfell/836cdd02c1cd1b0235840f1da4df17c1 to your computer and use it in GitHub Desktop.
Save jtfell/836cdd02c1cd1b0235840f1da4df17c1 to your computer and use it in GitHub Desktop.
var postcss = require('postcss');
module.exports = function(css) {
var root = postcss.parse(css);
// 1. Parse the AST and collect all font-size declarations
var properties = findFontSizeDecl(root);
// 2. Calculate the ratio used and the quality of the fit
var results = calculateRatio(properties);
console.log(results);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment