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

index.js « node « stylus « examples - github.com/twbs/rfs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 62ae685baa8cd245fd6bf53dffa5074039467a42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
'use strict';

const fs = require('fs');
const path = require('path');
const stylus = require('stylus');

const str = fs.readFileSync(path.join(__dirname, '/src/main.styl'), 'utf8');

stylus.render(str, {
  filename: path.join(__dirname, '/src/main.styl')
}, (err, css) => {
  if (err) {
    throw err;
  } else {
    fs.writeFile(path.join(__dirname, '/dest/main.css'), css, err => {
      if (err) {
        throw err;
      } else {
        console.log('Responsive font sizes generated.');
      }
    });
  }
});