Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compile SCSS at Runtime?

I have a project whose front-end is written in Sproutcore (1.6) and whose back-end is written in Ruby on Rails.

I've been using SCSS in the Sproutcore project and I now need to allow the client to change their colors on the fly. It doesn't have to be instantaneous, but they should be able to select their color, hit save and re-render the page with the new colors. The problem is, Sproutcore compiles the SCSS at build-time meaning I have no control over it once it's built and released.

As far as I've seen, only LESS can be compiled via Javascript at runtime. Does SCSS have this ability as well? If not, could I hack something together using my Ruby on Rails back-end?

like image 343
Topher Fangio Avatar asked Feb 13 '26 20:02

Topher Fangio


1 Answers

There is a Javascript version of SCSS.

https://github.com/bmavity/scss-js

However some things like Parameterized Mixins and Functions are not implemented yet.

like image 161
Thomas Bartelmess Avatar answered Feb 15 '26 12:02

Thomas Bartelmess



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!