How should one use Foundation with Laravel?
I thought I'd install Foundation in vendor
folder with bower install foundation
. This results into having a vendor/bower_components
folder where I have Foundation and all required libraries such as jQuery.
What should I add in gulpfile.js
for Elixir to interpret this correctly? It should be possible to
- update Bower components
- install new Bower packages
- modify Foundation Sass variables without these being overwritten when updating
- use Compass
In a non-Laravel project I would run the Ruby gem foundation new my_project
and include the compiled files manually. However, in this case the command creates a lot of files not required to work.
Laravel Elixir includes Libsass so you won't need Ruby to compile your Foundation Sass files from Laravel. All you'll need is bower and Laravel Elixir. Also you don't need to copy files from
bower_components
folder toresources/assets
folder.First follow official instrucctions for installing Elixir.
Then create the file
.bowerrc
in the root of your Laravel project with this content:Then create the file
bower.json
in the root of your Laravel project with this content:Then install both bower and foundation:
Then create the file
resources/assets/sass/_settings.scss
file with this content:Then edit the file
resources/assets/sass/app.scss
file with this content:Configure the file
gulpfile.js
with this content:To build just follow official docs:
Your compiled files will be at
public/css/app.css
andpublic/js/app.js
.To update to the latest Zurb Foundation version just run: