2
私のCSSシートでは、ブートストラップ3のプリセット値をリセットして私の好みのスタイルにする必要があります。.m-b-0
のようなユーティリティクラスが必要です。margin-bottom:0px
に設定してください。私は面倒で使っていたなぜLESSコンパイラはゼロイテレータによって生成されたクラスを認識しませんか?
あまりコンパイラは文句を言わない、私は他のクラスでそれらを入れ子になったときにループによって生成されたクラス.m-b-0
を認識するが、.m-b-1
と.m-b-10
などのクラスが正しく認識されます。その後、私のコンパイラはthrowed
.panel{
.m-b-0;
}
:
私の少ないファイルのループコードは、このようなものです:
.m-loop (@i) when (@i <= @iterations) {
[email protected]{i}{
margin: ~"@{i}px";
}
[email protected]{i}{
margin-left: ~"@{i}px";
margin-right: ~"@{i}px";
}
[email protected]{i}{
margin-top: ~"@{i}px";
margin-bottom: ~"@{i}px";
}
[email protected]{i}{
margin-left: ~"@{i}px";
}
[email protected]{i}{
margin-right: ~"@{i}px";
}
[email protected]{i}{
margin-top: ~"@{i}px";
}
[email protected]{i}{
margin-bottom: ~"@{i}px";
}
.m-loop(@i + 1);
}
.m-loop(0);
と私はこのように同じ小さいファイルに生成されることになったクラスを使用します
Running "less:production" (less) task
>> NameError: .m-b-0 is undefined in ../css/less/stylesheet.less on line 237, column 3:
>> 236 div.panel{
>> 237 .m-b-0;
>> 238 }
Warning: Error compiling ../css/less/stylesheet.less Used --force, continuing.
これは、コンパイル時にゼロ値のイテレータを使用することは禁止されていますか?それは間違っていますか?ありがとう!
申し訳ありませんが編集上の問題です。ループコードが実行されています。それは望ましいCSSを生成しましたが、mixin/nestingによって同じlessファイルで生成されたクラスを使用すると失敗します。 –