@rowLength: 100;
@counter: 100;
@prefix-cls: grid-stack;
@prefix-cls-item: grid-stack-item;

.loop(@counter) when (@counter >=0) {
  @result: (@counter / @rowLength) * 100%;

  .@{prefix-cls}>.@{prefix-cls-item}[gs-w="@{counter}"] {
    width: @result
  }

  .@{prefix-cls}>.@{prefix-cls-item}[gs-min-w="@{counter}"] {
    min-width: @result
  }

  .@{prefix-cls}>.@{prefix-cls-item}[gs-max-w="@{counter}"] {
    max-width: @result
  }

  .@{prefix-cls}>.@{prefix-cls-item}[gs-x="@{counter}"] {
    left: @result
  }

  .loop((@counter - 1));
}

.loop(@counter);

.@{prefix-cls}>.@{prefix-cls-item} {
  min-width: (1 / @rowLength) * 100%;
}

.@{prefix-cls}>.@{prefix-cls-item}[gs-w="0"] {
  width: 0%;
  min-width: 0%;
}
.@{prefix-cls}>.@{prefix-cls-item}[gs-h="0"] {
  height: 0%;
  min-height: 0%;
}