php:lessphp

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
php:lessphp [2022/09/25 07:20] ともやんphp:lessphp [2022/09/26 06:40] (現在) – [mixin その 1] ともやん
行 7: 行 7:
 Less (which stands for Leaner Style Sheets)\\ Less (which stands for Leaner Style Sheets)\\
  
-<WRAP color_code><code php>+===== サンプル ===== 
 + 
 +==== 演算 ==== 
 +<WRAP color_code mincode><code php>
 <php> <php>
 $less = new lessc; $less = new lessc;
-echo $less->compile(".block { padding: 3 + 4px }");+echo "<pre>\n"; 
 +echo $less->compile(<<< EOF 
 +.block { padding: 3 + 4px } 
 +EOF)
 +echo "</pre>\n";
 </php> </php>
 </code></WRAP> </code></WRAP>
 +<WRAP color_code mincode><php>
 +$less = new lessc;
 +echo "<pre>\n";
 +echo $less->compile(<<< EOF
 +.block { padding: 3 + 4px }
 +EOF);
 +echo "</pre>\n";
 +</php></WRAP>
 +
 +==== mixin その 1 (擬似クラス) ====
 +<WRAP color_code mincode><code php>
 +<php>
 +$less = new lessc;
 +echo "<pre>\n";
 +echo $less->compile(<<< EOF
 +.mixin {
 +  &:hover {
 +    color: red;
 +  }
 +}
 +#demo {
 +  .mixin;
 +}
 +EOF);
 +echo "</pre>\n";
 +</php>
 +</code></WRAP>
 +<WRAP color_code mincode><php>
 +$less = new lessc;
 +echo "<pre>\n";
 +echo $less->compile(<<< EOF
 +.mixin {
 +  &:hover {
 +    color: red;
 +  }
 +}
 +#demo{
 +  .mixin;
 +}
 +EOF);
 +echo "</pre>\n";
 +</php></WRAP>
 +
 +==== mixin その 2 (擬似要素) ====
 +<WRAP color_code mincode><code php>
 +<php>
 +$less = new lessc;
 +echo "<pre>\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 "</pre>\n";
 +</php>
 +</code></WRAP>
 +<WRAP color_code mincode><php>
 +$less = new lessc;
 +echo "<pre>\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 "</pre>\n";
 +</php></WRAP>
  
 ===== lesserphp テスト ===== ===== lesserphp テスト =====
行 18: 行 133:
 <div class="embed_codemirror"> <div class="embed_codemirror">
   <style>   <style>
 +    @import '/_media/javascript/codemirror/5.65.8/lib/codemirror.css';
 +    @import '/_media/javascript/codemirror/5.65.8/theme/cobalt.css';
 +    
     .dokuwiki pre {     .dokuwiki pre {
       box-shadow: unset;       box-shadow: unset;
 +    }
 +    .embed_codemirror .CodeMirror * {
 +      font-family: "HackGen Console NFJ", Arial, monospace;
 +      font-size: 10px;
     }     }
   </style>   </style>
    
-  <link rel="stylesheet" href="/_media/javascript/codemirror/5.65.8/lib/codemirror.css"> +  <!-- <link rel="stylesheet" href="/_media/javascript/codemirror/5.65.8/lib/codemirror.css"> --
-  <link rel="stylesheet" href="/_media/javascript/codemirror/5.65.8/theme/cobalt.css">+  <!-- <link rel="stylesheet" href="/_media/javascript/codemirror/5.65.8/theme/cobalt.css"> -->
   <script src="/_media/javascript/codemirror/5.65.8/lib/codemirror.js"></script>   <script src="/_media/javascript/codemirror/5.65.8/lib/codemirror.js"></script>
   <!-- 言語に応じたjsファイルを読み込む -->   <!-- 言語に応じたjsファイルを読み込む -->
  • php/lessphp.1664058038.txt.gz
  • 最終更新: 2022/09/25 07:20
  • by ともやん