Function

@nd

The step of a sequence as an offset from its middle, so the values are symmetric around 0. For five steps it is -2, -1, 0, 1, 2.

Syntax

  • @m5(@nd), @m5(@nd(<shift>))
shift
A number subtracted from every value. Default 0.

The value is @n - .5 - @N / 2 - shift, the sequence counterpart of @dx. Unlike @n, further operations are not arguments of @nd; write them in calc() around it.

Examples

@grid: 1 / 60vmin;
background: #000;
color: #fff;
font-size: 1.5em;
@content: @m5(@nd);

Shadows spread evenly on both sides:

@grid: 1 / 60vmin;
@size: 12%;
@place: center;
background: #000;
box-shadow: @m7(
  calc(@nd * 14px) 0 0 #e6437d
);

See also