Sass @while Rules

Last Updated:

Sass @while Rules

Sass @while Rules will evaluates its block of code as long as a specified expression is true.

Example

SASS TO CSS CONVERTER
@function scale-below($value, $base, $ratio: 1.618) { @while $value > $base { $value: $value / $ratio; } @return $value; } sub{ font-size: scale-below(20px, 16px); }

Syntax

@while <expression>{ // code };

Share this Page

Meet the Author