It is possible, but it is connected with hacking Sass and deepening into it. The best way, as iGel said, is to create different “themes” and incorporate it into your body depending on the user's preferences.
Say that you have main.css and some colors of the colors (let's say a different background body depending on the user's choice)
= stylesheet_include_tag 'main' = stylesheet_include_tag "#{@user.color_preferred}"
then you have ready-made colors like blue.sass, red.sass, green.sass, etc.
they are easy to generate, as you can just use the variable, as in your example, except that you need to reproduce it to support different colors.
source share