'Blueprint.js dynamic $ns variable in scss

I'm using Blueprint.js v3.x and have been making use of the SASS variables. I want to leverage the $ns variable, but my app is in dark mode. The $ns variable is set to bp3 !default; on line 10 of the file above, which from what I understand means I can set it to a different value in my app.scss. It would be fine, then, to just set $ns: bp3-dark; and use this variable that way. However, in the future I want to support a dark/light mode switch; how can I, following best practice, dynamically set $ns to be the correct value based on said switch?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source