====== lessphp - PHP で書かれた LESS コンパイラ ======
本家: [[http://lesscss.org/|Getting started | Less.js]]\\
[[https://leafo.net/lessphp/|LESS compiler in PHP - lessphp]]\\
[[git>MarcusSchwarz/lesserphp|GitHub - MarcusSchwarz/lesserphp: LESS compiler written in PHP]]\\
ドキュメント: [[https://www.maswaba.de/lesserphpdocs/|lesserphp Documentation - maswaba.de]]\\
Less (which stands for Leaner Style Sheets)\\
===== サンプル =====
==== 演算 ====
\n";
echo $less->compile(<<< EOF
.block { padding: 3 + 4px }
EOF);
echo "
\n";
\n";
echo $less->compile(<<< EOF
.block { padding: 3 + 4px }
EOF);
echo "
\n";
\n";
echo $less->compile(<<< EOF
.mixin {
&:hover {
color: red;
}
}
#demo {
.mixin;
}
EOF);
echo "
\n";
\n";
echo $less->compile(<<< EOF
.mixin {
&:hover {
color: red;
}
}
#demo{
.mixin;
}
EOF);
echo "
\n";
\n";
echo $less->compile(<<< EOF
.custom_scroll {
&::-webkit-scrollbar {
width: 10px; // 縦スクロールバーの幅
height: 10px; // 横スクロールバーの幅
}
&::-webkit-scrollbar-track {
border-radius: 5px;
box-shadow: inset 0 0 6px rgba(50, 50, 50, .9);
}
&::-webkit-scrollbar-thumb {
background-color: rgba(128, 128, 128, .3);
border-radius: 5px;
box-shadow:0 0 0 1px rgba(255, 255, 255, .3);
}
}
.dokuwiki {
.wrap_color_code {
// mixin
.custom_scroll;
}
}
EOF);
echo "
\n";
\n";
echo $less->compile(<<< EOF
.custom_scroll {
&::-webkit-scrollbar {
width: 10px; // 縦スクロールバーの幅
height: 10px; // 横スクロールバーの幅
}
&::-webkit-scrollbar-track {
border-radius: 5px;
box-shadow: inset 0 0 6px rgba(50, 50, 50, .9);
}
&::-webkit-scrollbar-thumb {
background-color: rgba(128, 128, 128, .3);
border-radius: 5px;
box-shadow:0 0 0 1px rgba(255, 255, 255, .3);
}
}
.dokuwiki {
.wrap_color_code {
// mixin
.custom_scroll;
}
}
EOF);
echo "
\n";