0

I am looking fo the following:

Lets say i have a main.scss which contains al my css.

At the top of the file i have the following line:

@import "partials/vars";

This contains all my variables that i'm using in my main.scss (like colors, padding, etc...)

The problem is that my application will be used by multiple clients. Each with their own colour schemes etc.

So what i would like is the easiest method (if there is one) to say:

i have my main file and i compile it to eg:

company1.css company2.css company3.css

Each of them containing the same css code but with their own colour scheme.

if its company1 then it should import 'partials/company1Vars.scss company2 loads company2vars.scss etc

Any help would be appreciated.

Vincent
  • 331
  • 1
  • 3
  • 9
  • Possible duplicate of [SASS output from one sass file to multiple css files](https://stackoverflow.com/questions/33694609/sass-output-from-one-sass-file-to-multiple-css-files) – ithil Jun 06 '17 at 15:13

1 Answers1

0

Not sure how many companies you have but if it's not some insane number, you could probably have:

company1Styles.scss company2Styles.scss company3Styles.scss etc.

Each of those would contain a line like

@import "partials/_company1Vars.scss"
@import "_screen.scss"; // contains everything else

or

@import "partials/_company2Vars.scss"
@import "_screen.scss"; // contains everything else

You could change the variables independently of everything else in your project and get different outputs.

imjared
  • 19,492
  • 4
  • 49
  • 72
  • You should not include the underscores in the `@import` statements according to the docs: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#partials – Haralan Dobrev Mar 14 '14 at 11:15
  • @HaralanDobrev I'm not sure that's true, can you specify the part of the docs that say that you should not include the underscore? Seems like a style thing. – imjared Mar 15 '14 at 19:54