SASS ignores variables, defined in if-statement

That’s completely expected. Variables have a scope to them. If you define them inside of a control block (like an if statement), then they won’t be available outside. So, what you need to do is initialize it outside like so: $text-color: null; $background-color: null; @if $colorscheme == white { $text-color: #333; $background-color: #fff; } @else … Read more

SASS Variable within string [duplicate]

Yes, you just have to use variable interpolation. Example: @mixin post-link ($class, $color, $hover) { a.#{$class}:link { color: $color; } a.#{$class}:hover { color: $hover; } } Example on SassMeister: http://sassmeister.com/gist/9533103 The key is adding #{ and } around your variable names to get them expanded.

Does Sass have a switch function?

No there isn’t any supported switch statement in sass but if you only need to use the switch statement to tweak a variable, you can use sass maps in a switch statement sort of way. Using SASS maps in place of a switch statement $newVar: map-get(( case_1_test_name : case_1_return_value, case_2_test_name : case_2_return_value, ), $testVar); So … Read more

How to use SASS with Netbeans 8.0.1

Installing SASS on Windows10, Ruby2.2.3, Netbeans8 Download SASS for Windows – RubyInstaller.org Install Ruby like: Search windows for CMD (Command Prompt) and start it. Access Ruby’s bin folder using cd \Ruby\bin (Hit Enter) Install sass using the command gem install sass (Hit Enter to install) Wait for the installation to finish In Netbeans open Options … Read more

How to manage SCSS stylesheets across a monorepo with different libraries sharing variables?

I think I might have something here, this is the solution I’ve adopted after some back ‘n forth with the NRWL team. I create an NX workspace by first creating a project with the angular CLI, and then adding the extensions, like so: ng new myproject (cd into myproject root) ng add @nrwl/workspace In addition, … Read more