0

mixin の少ない関数を異なるパラメーターで 2 回呼び出しますが、結果は同じで、最初のパラメーターによって作成されます。例があります:

入力:

.font-face (@fontName, @fontFileName)
{
    @font-face {
        font-family: @fontName;
        src: url("../../fonts/@{fontFileName}.eot");
        src: url("../../fonts/@{fontFileName}.eot?#iefix") format("embedded-opentype"),
             url("../../fonts/@{fontFileName}.woff") format("woff"),
             url("../../fonts/@{fontFileName}.ttf") format("truetype");
        font-weight: normal;
        font-style: normal;
    }
}

.font-face ("BMitra", "BMitra");
.font-face ("BMitraBold", "BMitraBold");

出力:

@font-face {
  font-family: "BMitra";
  src: url("../../fonts/BMitra.eot");
  src: url("../../fonts/BMitra.eot?#iefix") format("embedded-opentype"), url("../../fonts/BMitra.woff") format("woff"), url("../../fonts/BMitra.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: "BMitra";
  src: url("../../fonts/BMitra.eot");
  src: url("../../fonts/BMitra.eot?#iefix") format("embedded-opentype"), url("../../fonts/BMitra.woff") format("woff"), url("../../fonts/BMitra.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

どうしたの?ASP .Net MVC 3.0 アプリケーションで dotless を使用しています。

4

2 に答える 2

2

現在のバージョンでは、@mediaと@font-faceの両方がless.jsとdotlessの両方でサポートされています。

ただし、ミックスインを介して@ font-faceブロックを配置することは、比較的新しい領域です。バグのように見えます。

[編集]

回避策があるless.jsのバグはすでにあります。

[編集2]

これはドットレスメインで修正されました。

于 2012-04-18T07:56:08.020 に答える
0

悪いニュース: LessCSS での @media と @font-face のサポート。'@font-face' は LESS CSS ではまだサポートされていません :(

于 2012-04-13T21:38:31.697 に答える