user11075555
user11075555

Reputation:

How should I structure sass and css in my project

I'm a newbie to Sass and try to create a folder structure which works with minimal effort when compiling. I want to create multiple files in each multiple directories which have the same name with the file (/.css) and my sass files are located in app/sass folder so that it's transferred with no effort.

I've done a research for the simple tricks of cd notation of any command line but later I understood that the notation of Sass can be different. I've looked for Gulp and Grunt and still couldn't find exactly anything on sending css files to multiple destinations which have the same name. I've searched Sass/CSS structures but I still cannot figure it out how to use a single CSS file for the entire project.

-app
  -sass
    -index.scss
    -admin.scss
-public
  -index
    -index.css
  -admin
    -admin.css
sass --watch app/sass/*.scss:public/css/*/*.css

What should I write instead of * that functions as a parameter for everyone?

Upvotes: 0

Views: 225

Answers (1)

Vincent
Vincent

Reputation: 2093

The Sass guide on their website: https://sass-lang.com/guide tells you to do it like this:

sass --watch app/sass:public/stylesheets

And this link [ sass watching multiple directories ] says you can specify more then one path to watch:

sass --watch path/to/sass1:path/to/css1 path/to/sass2:path/to/css2 path/to/sass3:path/to/css3

So you can watch multiple paths, but still have to specify each of them.

Upvotes: 2

Related Questions