juliancwirko / generator-zf5

Yeoman generator for Zurb Foundation 5
https://www.npmjs.com/package/generator-zf5
MIT License
204 stars 29 forks source link

generator-zf5

Yeoman generator for Zurb Foundation 5.

This project is not maintained anymore. There is Foundation for Sites 6 go and check it: foundation.zurb.com Also check out advanced starter project based on Gulp including Handlebars templates, UnCSS and many more: Foundation 6 Starter docs Also check out Getting Started with Foundation 6’s CLI Tools. Thanks!

Learn more about it (blog post):

Foundation 5 and Yeoman generator-zf5

Important note:

Default option here will be Sass with Libsass (for now). But you can choose Ruby version on startup.

NPM

NPM

Yo Foundation 5!

Getting Started

$ npm install -g yo

To install generator-zf5 from npm, run:

$ npm install -g generator-zf5

Finally, initiate the generator:

$ yo zf5

Grunt tasks:

run project (compile Sass, bower install, livereload (server on 127.0.0.1:9000), watch)

$ grunt

publishing project (into dist directory) (compile Sass, validate-js, copy, concatenation, minifications)

$ grunt publish

dist directory preview (server on 127.0.0.1:9001)

$ grunt server-dist

Other Grunt tasks (if you want to use it)

..for validating javascript

$ grunt validate-js

..for injecting bower libraries (also in default grunt task)

$ grunt bower-install

..for compiling Sass files + autoprefixer on app.css file

$ grunt compile-sass

Ruby Sass with Compass or Node Sass (Libsass)

From version 0.7.0 you can use Ruby version of Sass with Compass. If you want to use Ruby version first of all you need to install compass by 'gem install compass' (it will install Sass gem too).

You don't need to use the config.rb file, all is configured in Gruntfile.js (Sass block). There will be also Compass imports in _appstyles.scss (You can modify it). If you have any problems with using Sass with Compass it is good to uninstall any of your Sass gems and Compass gems and install only Compass gem again. It will fetch proper version of Sass gem.

Ruby Sass config info: https://github.com/gruntjs/grunt-contrib-sass

You can also use Libsass version (default) which is very fast.

Node Sass config info: https://github.com/sindresorhus/grunt-sass

Please test this and send issues if any.

LiveReload

For LiveReload call 'grunt' (watching) command and go to http://127.0.0.1:9000

Usemin

Read more about grunt-usemin

Bower-install

Now you can install your libraries much faster. Example:

bower search magnific-popup
...
bower install magnific-popup --save
...
grunt bower-install

This should inject the proper js and css paths into your html files. But you should be careful and check what was injected. 'grunt publish' will then minify and concatenate them into a clean (libraries.min.css and libraries.min.js) files. Instead of a 'bower install' with '--save' you can manualy edit the bower.json file and then run a 'grunt bower-install'. It is also included in the default task - 'grunt'.

Tips

<!-- build:js js/mfpopup/mfpopup.min.js -->
    <script src="https://github.com/juliancwirko/generator-zf5/raw/master/js/mfpopup/mfpopup.js"></script>
<!-- endbuild -->

and

<!-- build:css css/mfpopup/mfpopup.min.js -->
    <script src="https://github.com/juliancwirko/generator-zf5/raw/master/js/mfpopup/mfpopup.js"></script>
    <script src="https://github.com/juliancwirko/generator-zf5/raw/master/js/mfpopup/other_script.js"></script>
<!-- endbuild -->

you can add new ones

You can test it and tell me please if something is not working.

Getting To Know Yeoman

Yeoman has a heart of gold. He's a person with feelings and opinions, but he's very easy to work with. If you think he's too opinionated, he can be easily convinced.

If you'd like to get to know Yeoman better and meet some of his friends, Grunt and Bower, check out the complete Getting Started Guide.

License

MIT License

Contact

@juliancwirko | julian.cwirko@gmail.com

Changelog

..see CHANGELOG.md file