Sass random() Function

Last Updated:

Sass random() Function

The random() function returns a random decimal number between 0 and 1.

Example

SASS TO CSS CONVERTER
@debug random(); // 0.2821251853 @debug random(); // 0.6221325812

Syntax

random()

Return Value

ValueExplanation
Number Returns a random decimal number between 0 and 1.

Sass random() Function using Parameter

If the parameter is a number greater than or equal to 1, returns a random whole number between 1 and parameter.

Example

SASS TO CSS CONVERTER
@debug random(10); // 6 @debug random(100); // 84

Share this Page

Meet the Author