Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
module Sass::Script::Functions
def random(max = Sass::Script::Number.new(100))
Sass::Script::Number.new(rand(max.value), max.numerator_units, max.denominator_units)
end
end
@serv

This comment has been minimized.

Copy link

@serv serv commented Sep 18, 2012

Hi,
Where would you insert this kind custom code for gems in Rails typically?
Thank you.

Jason

@jeffbkk

This comment has been minimized.

Copy link

@jeffbkk jeffbkk commented Oct 10, 2013

Hi,
Using Bourbon mixin, non-progrmmer, i have to clue where to put this file... Should i inject it into function.rb modules or should i create a rb file somewhere on my system ?

Thank you

@elisechant

This comment has been minimized.

Copy link

@elisechant elisechant commented Nov 3, 2013

@serv @jeffbkk
Yeah add it to the end of your compass.rb if you're using Compass

and run

compass compile --force

or check out http://blog.codepen.io/2013/09/17/adding-random-function-sass/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.