I'm using the gem rails/webpack to build the assets, but I need build a dynamic SCSS according by a brand, like:
//admin.scss
@import 'variables-<%= 'brand-name' %>';
body {
background: $primary-color;
}
I have tried adding the loader:
{
test: /\.scss(\.erb)?/,
loader: 'sass-loader',
options: { importExtensions: ['.scss', '.scss.erb', '.css'] }
}
but that didn't work. Is there a way to do something like that?
variable in rails app :
pass to sass with Hash var :
use variable in ur style file :