I am in the process of creating a website using Rails 3 which will allow users to customize their profiles with different layouts and color schemes. I have already implemented SASS, and I believe it would be incredibly useful if I could achieve something like this…
<link src="base_styles.css" rel="stylesheet">
<link src="color_schemes/users_choice.css" rel="stylesheet">
<link src="layouts/users_choice.css" rel="stylesheet">
…where the color scheme details would mainly (if not entirely) consist of SASS variables specifying the colors to be used in the layout. Of course, I cannot simply link the SASS or CSS files in this way; I would need to import them into SASS.
Is there a way to dynamically import SASS files into the parser at request-time and then cache the resulting CSS files for future use?
I have considered the less optimal option of pre-building every possible combination upon deployment, but that approach falls short if I want to offer users the ability to set their own colors down the line. It feels like a missed opportunity with SASS, as though it should be possible to implement such functionality seamlessly.