kristoferjoseph / postcss-modular-scale

PostCSS plugin for adding modular scale to your styles
MIT License
53 stars 9 forks source link

Allow options to be passed via CLI #2

Closed kristoferjoseph closed 9 years ago

kristoferjoseph commented 9 years ago

Currently you can pass in ratios and bases from css variables. We also need to allow these variables to be passed via code.

Example

postcss --use postcss-modular-scale -c options.json -o screen.css screen.css

// dependencies 
var fs = require("fs")
var postcss = require("postcss")
var modularScale = require("postcss-modular-scale")

// css to be processed 
var css = fs.readFileSync("input.css", "utf8")

// process css 
var output = postcss()
  .use(modularScale({ ratios: [2], bases: [12,16]}))
  .process(css)
  .css
JamesJosephFinn commented 8 years ago

Perfect — thank you! This helped me out tremendously. I couldn't figure out how to get the plugin to read the ugly the double hyphen vars in my stylesheet.

JamesJosephFinn commented 8 years ago

You should put this in the ReadMe — and, thanks again! :+1: