If you go with the approach I mentioned above, you could always move any SASS out of app.scss and into another file, maybe "_core.scss" for example. Then your entire app.scss file would only include imports where you can control the order of the output ...
[01:56:19] gulp-notify: [Laravel Elixir] Sass Compilation Failed: resources/assets/sass/app.scss
Error: It's not clear which file to import for '@import "buttons.scss"'.
Candidates:
buttons.scss
_buttons.scss
Please delete or rename all but one of these files.
on line 2 of stdin
>> @import 'buttons.scss';
^
I have tried to rename the file to both "_buttons.scss" and "buttons.scss".
var elixir = require('laravel-elixir');
/*
|--------------------------------------------------------------------------
| Elixir Asset Management
|--------------------------------------------------------------------------
|
| Elixir provides a clean, fluent API for defining some basic Gulp tasks
| for your Laravel application. By default, we are compiling the Sass
| file for our application, as well as publishing vendor resources.
|
*/
elixir(function(mix) {
mix.sass([
'app.scss',
], 'public/assets/css');
});
Look I have that buttons.scss file that imports another files as well. I feel like I should put them all together including another sub-folder contains more scss file.
screenshot of the folder (check out the buttons.scss file that imports all the other files you see):
I think you are on the right track. My sass is broken down, some in sub directories, etc. In some cases I have a directory with several files so I create an index there that simply has import statements for the rest of the items in the directory so that the parent just has to import the index ... the index imports the other items.
So yeah it's compiling now well.All I had to do is to import ALL scss files to the resources/assets/sass folder.That's because I am using a library and it has multiple files. I noticed it's requiring another files so that's where I had to move it all together.
Next compile using 'gulp' command.
Then you'd be able to see the code compiled into one 'app.css' file in public/assets/css folder.
A partial is simply a Sass file named with a leading underscore. You might name it something like _partial.scss. The underscore lets Sass know that the file is only a partial file and that it should not be generated into a CSS file
So that might explain why it wasn't compiled to CSS file (and only app.scss was)