I search the proper way to do that in SASS, I don't know if it's possible.
For my exemple I've a website in laravel with 3 subdomains. These 3 subdomains will have the same site structure, but data and styles will be different.
In laravel I've a variable subdomain like that: {subdomain}.mysite.com So if I go to green.mysite.com it will load for example green.css
I want to use sass in a modular way and have:
common.scss all styles common to all subdomains with undefined variables (like colors)
green.scss color variables and some stuff are defined here
purple.scss variables for purple theme
And for code example in common.scss I would have something like that:
#main-footer{
border-top: 4px solid $main;
}
And in green.scss:
/* COLORS */
$main: #8cc83d;
$second: #d38345;
Is this possible to do in particular way in SASS or I've to copy paste all my code which contain vars ? :/
$primary,$secondary,$link,$accentand so on) you could sort of accomplish this by simply having different master files that import each respective settings/vars definitions file into the sass build for that specific site. You'll still have 3 separate compiled SASS files to manage but at least you can still keep most of your code in a centralcommon.scssfile that is compiled into each site._vars.cssdefinition files, and three separatemain.scssfiles (one for each site) that each import the_common.scssmain styles and the_vars.cssfile for each respective color scheme.