29.07.2016 Views

laravel-5

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Laravel Elixir 229<br />

1 elixir(function(mix) {<br />

2 A> mix.sass([<br />

3 A> 'app.scss',<br />

4 A> 'controllers.scss'<br />

5 A> ], 'public/assets/css');<br />

6<br />

7 });<br />

Plain CSS<br />

If you would just like to combine some plain CSS stylesheets into a single file, you may use the<br />

styles method. Paths passed to this method are relative to the resources/assets/css directory<br />

and the resulting CSS will be placed in public/css/all.css:<br />

1 elixir(function(mix) {<br />

2 A> mix.styles([<br />

3 A> 'normalize.css',<br />

4 A> 'main.css'<br />

5 A> ]);<br />

6<br />

7 });<br />

Of course, you may also output the resulting file to a custom location by passing a second argument<br />

to the styles method:<br />

1 elixir(function(mix) {<br />

2 A> mix.styles([<br />

3 A> 'normalize.css',<br />

4 A> 'main.css'<br />

5 A> ], 'public/assets/css');<br />

6<br />

7 });<br />

Source Maps<br />

Source maps are enabled out of the box. So, for each file that is compiled you will find a companion<br />

*.css.map file in the same directory. This mapping allows you to trace your compiled stylesheet<br />

selectors back to your original Sass or Less while debugging in your browser.<br />

If you do not want source maps generated for your CSS, you may disable them using a simple<br />

configuration option:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!