krasimir / grunt-absurd

Grunt plugin for AbsurdJS compilation
MIT License
10 stars 1 forks source link

How to build off of bootstrap #2

Open autoferrit opened 10 years ago

autoferrit commented 10 years ago

I want to be able to take my bootstrap.css file, convert that to an absurd js file. then in my app I want to have my own styles.js file. So then I can compile the bootstrap and styles files into a single normal css file. this way my own styles in styles.js overwrite anything in the bootstrap file.

From reading the readme file, I dont see how I can setup a grunt task to do this.

Thanks.

krasimir commented 10 years ago

I'm travelling right now and can't really test this, but:

grunt.initConfig({
  absurd: {
    buildCSS: {
      options: {
        combineSelectors: false
      },
      expand: true,
      src: ['css/index.js'],
      dest: 'public/css/styles.css'
    }
  }
});

And then in index.js:

var fs = require('fs');
module.exports = function(api) {
  api.importCSS(fs.readFileSync('path/to/bootstrap.css'));
  api.add({
    ...
  })
}