Jens Törnell Jens Törnell - 9 months ago 51
Sass (Sass) Question

Shorter way to import with Scss/Sass

I use Scss (gulp-sass) and it's a long list of includes that looks kind of like this:

@import '../../snippets/menu/menu.scss';
@import '../../snippets/footer/footer.scss';
@import '../../snippets/hero/hero.scss';

From this I can see a pattern. My question is if there is a nice way to make it simpler to write. Maybe something like this?


The output for scss should still be like the first snippet.


I was pushed in the right direction in the comments and the solution was a bit different than I expected. Now I use:

I allows for syntax like this:

@import '../../snippets/**/*';