Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/rfs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'examples/postcss/index.js')
-rw-r--r--examples/postcss/index.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/examples/postcss/index.js b/examples/postcss/index.js
new file mode 100644
index 0000000..f005f6a
--- /dev/null
+++ b/examples/postcss/index.js
@@ -0,0 +1,28 @@
+'use strict';
+
+const fs = require('fs');
+const path = require('path');
+const postcss = require('postcss');
+const rfs = require('../../postcss');
+
+const css = fs.readFileSync(path.join(__dirname, '/src/main.css'), 'utf8');
+const options = {
+ twoDimensional: false,
+ baseValue: 20,
+ unit: 'rem',
+ breakpoint: 1200,
+ breakpointUnit: 'px',
+ factor: 10,
+ class: false,
+ unitPrecision: 6,
+ safariIframeResizeBugFix: false,
+ remValue: 16
+};
+
+const processedCss = postcss(rfs(options)).process(css).css;
+
+fs.writeFile(path.join(__dirname, '/dest/main.css'), processedCss, err => {
+ if (err) {
+ throw err;
+ }
+});