在内容之前不工作手写笔标题循环

Not working stylus heading loop before content

工作代码:

手写笔

for num, $s in (1..6)
    h{$s+1}
        display inline-block

HTML

h1:before {
  position: relative;
}
h2:before {
  position: relative;
}
h3:before {
  position: relative;
}
h4:before {
  position: relative;
}
h5:before {
  position: relative;
}
h6:before {
  position: relative;
}

无效代码:

手写笔

for num, $s in (1..6)
    h{$s+1}
        &:before
            display inline-block
            content h{$s+1}

如何使生成的代码能够显示在下一个css

之前的内容中

HTML

h1:before {
  content: "h1";
}
h2:before {
  content: "h2";
}
h3:before {
  content: "h3";
}
h4:before {
  content: "h4";
}
h5:before {
  content: "h5";
}
h6:before {
  content: "h6";
}

任何可能的解决方案?

工作代码:

手写笔

for $i in (1..6)
    h{$i}
        &:before
            content "h" + $i

HTML

h1:before {
  content: 'h1';
}
h2:before {
  content: 'h2';
}
h3:before {
  content: 'h3';
}
h4:before {
  content: 'h4';
}
h5:before {
  content: 'h5';
}
h6:before {
  content: 'h6';
}