Sass unique-id() Function

Last Updated:

Sass unique-id() Function

The unique-id() function returns a randomly-generated unquoted string that’s guaranteed to be a valid CSS identifier and to be unique within the current Sass compilation.

Example

SASS TO CSS CONVERTER
//Check your console @debug unique-id(); // uabtrnzug @debug unique-id(); // u6w1b1def

Syntax

unique-id()

Return Value

ValueExplanation
string Returns a randomly-generated unquoted string that’s guaranteed to be a valid CSS identifier and to be unique within the current Sass compilation.

Share this Page

Meet the Author