Function

@hex

A number written in hexadecimal: @hex(255) is ff.

Syntax

  • @hex(<number>)

The number is truncated to an integer. Values below 16 give a single digit, so pad or pick a range that starts at 16 when building colors.

Examples

@grid: 5 / 60vmin _1px;
background: #@rep3.hex.r(16, 255);

This is the older way to input a unicode character: a \ plus hex digits, which CSS reads as an escape. It only works in CSS content.

@grid: 5 / 60vmin _1px;
background: #000;
color: #fff;
:after {
  content: \@hex.@r(9632, 9687);
}

@code was added later to write the character itself, so the same number works in @content too.

@grid: 5 / 60vmin _1px;
background: #000;
color: #fff;
@content: @code.r(9632, 9687);

See also