5
SOを少し掘り下げたところ、テーブルの丸みを帯びたコーナーが必要なのは、thisでした。以下のCSSスニペットに私を導く角が丸くなった角テーブルLESS
:
.greytable tr:first-child th:first-child {
-moz-border-radius-topleft: 5px;
-webkit-border-top-left-radius: 5px;
border-top-left-radius: 5px;
}
.greytable tr:first-child th:last-child {
-moz-border-radius-topright: 5px;
-webkit-border-top-right-radius: 5px;
border-top-right-radius: 5px;
}
.greytable tr:last-child td:first-child {
-moz-border-radius-bottomleft: 5px;
-webkit-border-bottom-left-radius: 5px;
border-bottom-left-radius: 5px;
}
.greytable tr:last-child td:last-child {
-moz-border-radius-bottomright: 5px;
-webkit-border-bottom-right-radius: 5px;
border-bottom-right-radius: 5px;
}
は今、私はLESSで、これらすべてを簡素化することができるか知りたいのです。私は、次のLESSコードを試みた:
.border-radius (@v, @h, @radius: 5px) {
[email protected]@h: @radius;
[email protected]@h: @radius;
[email protected]@h: @radius;
}
をそして、(左上隅のために)それを呼び出す:
.greytable tr:first-child th:first-child {
.border-radius('top', 'left')
}
しかし、それは動作しません(LESSスニペットの2行目にエラー) 。
ありがとうございます!
ハードコーディングの間違いを修正しました。それに応じて編集することができます。どうもありがとう! – janosrusiczki
少なくともWinLessではまだ動作しません。 – janosrusiczki
ええ、私はすぐにそれを理解するために困惑し、あまりにも疲れています。私は明日チェックインし、あなたがどのように作り出したかを見るでしょう。 –