Yes, as Scott said, it is possible, but I am not a Rails programmer, so I just wanted to copy and paste the code, but at first I did not know where to place the code, and then it does not work. I had to play with a margin and expand it to the more flexibility I need:
module Sass::Script::Functions module USW_Random ## Create random Color # inspired by: http:
Ths can be used in the SCSS file as follows:
@debug usw_random(); @debug usw_random(10); @debug usw_random(8, 2); @debug usw_randomColor();
and prints:
xxx.scss:25 DEBUG: 0.42782 xxx.scss:26 DEBUG: 3 xxx.scss:27 DEBUG: 5 xxx.scss:28 DEBUG: #e7c00b
I also did not know where to put the code for this. I use SASS as part of a compass. You can place this code directly in the Compass Config.rb file.
Or you put it in another file and put this line in your Compass Config.rb file:
## my "own" ruby functions. require "../SASS/RUBY/at.usw.rb"
source share