peterramsing / lost

LostGrid is a powerful grid system built in PostCSS that works with any preprocessor and even vanilla CSS.
http://lostgrid.org
MIT License
4.5k stars 160 forks source link

Brunch instructions #99

Closed dmitrykiselyov closed 9 years ago

dmitrykiselyov commented 9 years ago
Brunch
exports.config =
  # See http://brunch.io/#documentation for docs.
  files:
    javascripts:
      joinTo: 'app.js'
    stylesheets:
      joinTo: 'app.css'
    templates:
      joinTo: 'app.js'
  plugins:
    postcss:
      config: (postcss) ->
        postcss().
        use(require('autoprefixer')(['last 1 versions']).postcss).
        use(require('lost').postcss)

This will watch your app/style.css file for any changes and then process it with Autoprefixer and Lost Grid (which will convert Lost Grid rules into vanilla CSS code), and output the processed CSS to public/app.css.

NOTE: postcss-brunch has issue, but with this fix is ok, but will work only with a vanilla CSS and Less.

⬆ back to top

 

corysimmons commented 9 years ago

Thanks. Can you add on to this with JavaScript (instead of Coffee) and Autoprefixer and have it watch a specific directory and output to a specific directory (to be more inline with the other instructions)?

dmitrykiselyov commented 9 years ago

But Brunch is different :smile: Config by default is coffee. Min config and all ready to go

exports.config =
  files:
    javascripts:
      joinTo: 'app.js'
    stylesheets:
      joinTo: 'app.css'
corysimmons commented 9 years ago

Oh is Brunch heavily Coffee friendly? :)

corysimmons commented 9 years ago

Want to open a PR and get some GitHub commit credit?

dmitrykiselyov commented 9 years ago

No :smile: Just a second, please.

dmitrykiselyov commented 9 years ago

Ok, instruction 100% is ready :+1:

corysimmons commented 9 years ago

Okay, just confirming you don't want to PR?

dmitrykiselyov commented 9 years ago

Ok. But tommorow. It's too late.

teddybradford commented 9 years ago

PR https://github.com/corysimmons/lost/pull/101 merged. This issue can be closed now.

dacodekid commented 9 years ago

@corysimmons, I'm completely new to Brunch (just started today), but according to Brunch's doc, you can use either 'coffeescript' or 'javascript' as your config file. Here is the closest JS to your gulp file.

exports.config = {
    paths: {
        "public": 'dist'
    },
    files: {
        stylesheets: {
            joinTo: 'css/app.css'
        }
    },
    plugins: {
        postcss: {
            config: function(postcss) {
                return postcss()
                    .use(require('autoprefixer')(['last 1 versions']))
                    .use(require('lost'));
            }
        }
    }
}
corysimmons commented 9 years ago

Ah alright thanks.