如何在Jade中嵌入转义的scss代码

时间:2015-10-10 11:16:22

标签: templates pug prepros

我使用Prepros编译* .jade模板。

当前的翡翠代码:

pre
  code.hljs
    .ui-button {
      @include button;
      &.xs {@include button-size(xs);}
      &.sm {@include button-size(sm);}
      &.md {@include button-size(md);}
      &.lg {@include button-size(lg);}
      &.xl {@include button-size(xl);}
      &.xxl {@include button-size(xxl);}
    }

预期结果:

<pre>
  <code class="hljs">
.ui-button {
  @include button;
  &amp;.xs {@include button-size(xs);}
  &amp;.sm {@include button-size(sm);}
  &amp;.md {@include button-size(md);}
  &amp;.lg {@include button-size(lg);}
  &amp;.xl {@include button-size(xl);}
  &amp;.xxl {@include button-size(xxl);}
}
  </code>
</pre>

1 个答案:

答案 0 :(得分:0)

<强>答案:

CSS代码不需要代码转义。

pre
  code.hljs
    | .ui-button {
    |   @include button;
    |   &.xs {@include button-size(xs);}
    |   &.sm {@include button-size(sm);}
    |   &.md {@include button-size(md);}
    |   &.lg {@include button-size(lg);}
    |   &.xl {@include button-size(xl);}
    |   &.xxl {@include button-size(xxl);}
    | }