問題タブ [lessphp]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
css - Less PHP でメディアクエリを解析できない
私の Less ファイルには、Less でメディアクエリに使用したいいくつかの変数が含まれています。
私のcssでは、たとえば次のようにします:
プリプロセッサで解析しようとするとコンパイルされますが、LessPHP で解析すると次のエラーが発生します。
less - 変数内の LESSPHP リンク
Google フォントをスタイルシートにインポートするには、less 変数を使用する必要があります。私がやっている現在の方法は次@import url(@{googleFonts});
のとおりです。LESSPHPに渡す変数は次のとおりです。"googleFonts" => "http://fonts.googleapis.com/css?family=Linden+Hill"
ただし、コンパイルするのは次のとおりです。import url(http);
私が試した過去のインポートステートメントは次のとおり@import url(http://fonts.googleapis.com/css?family=@{googleFonts});
です。Linden+Hall
これはうまく機能しましたが、ここで遭遇した問題は + が削除されていたことです。ちょうど出発しLindenHall
ます。
したがって、コンパイラが + をそのままにしておく方法を知っていれば、それも問題なく機能します。
css - lessphp は、LESS CSS コメントを 1 か所にまとめます
.less ファイルをコンパイルするときに、これらのコメントを何らかの方法でスキップ/削除できますか? 今はばかげているように見えるからです。すべてのコメントは、.css ファイルの先頭にまとめられています。
Drupal 7、Bootstrap 3.0.0、D7 用の LESS プリプロセッサ モジュール、lessphp ライブラリを使用しています。
lessc.inc.php には、setPreserveComments を含む 1 行しかありません。
http://leafo.net/lessphp/docs/#preserving_commentsのドキュメントと一致しません
css-selectors - LessCss: nesting groups of selectors
Say in my main.less
file which gets compiled into main.css
, I have the following:
Clearly this is already becoming unwieldy, excessively cluttering my main.less file and adding duplication of sorts which could cause multiple unnecessary changes.
How can I improve this? Is there a way I could for example do something like this:
Thanks
Edit 1: As per @Alessandro Minoccheri's suggestion, I compiled but the resulting css was as follows:
Any mention of the classes that would be covered by .allCellTypes
are completely omitted. Perhaps there are two reasons for this?
- The definitions for the classes which would be grouped into
.allCellTypes
are defined elsewhere (within compiled bootstrap files). - I compile the
.less
files using lessphp, perhaps it has a bug?
Edit 2: I placed the following code in the demo window on the lessphp page...
and I got the following result:
So I'm afraid your answer, @Alessandro Minoccheri, is not doing what I wanted!
symfony - Symfony2 LessPHP は開発環境では正常に動作しますが、本番環境では動作しません
LessPHPを使用してSymfony2の下にWebサイトがあります。開発環境では、すべて正常に動作します。http://mylocalsite/app_dev.php/
ブラウザを叩くとhttp://mylocalsite/app_dev.php/css/XXXX_myFile_1.css
.
しかしhttp://mylocalsite/
、ブラウザにアクセスするhttp://mylocalsite/css/XXXX_myFile_1.css
と、アクセスしようとして 404 エラーが発生します。
prod.log にはこれ以上は含まれません
config.yml
小枝のテンプレート
編集
私はファイルphp app/console assetic:dump --env=prod --no-debug
をくれました。web/css/XXXX.css
しかし、ブラウザはまだ というファイルを探していますXXXX_myFile_1.css
。
私はこのように出力を設定しようとしました
私にファイルphp app/console assetic:dump --env=prod --no-debug
を与えた別の時間を実行しました。web/css/myFile.css
しかし今、ブラウザはmyFile_myFile_1.css
.
答え
use_controller
config.yml ファイルでtrueに設定する必要があります。
ありがとう
php - LessPHP、Basset & Laravel - 奇妙な解析エラー
Laravel で LESS 解析をうまく機能させるのに苦労しています。私はいくつかのグーグルを行い、LESSをサポートしているように見えるBassetを見つけましたが、実際にはLESSを解析していないことがわかりました。そこで、解析を行うために LessPHP もインストールしました。
ここで、世界で最も単純な LESS ファイルを使用しようとすると、次のようになります。
うまくいきません。「解析エラー」が発生します。
ここで私が犯した信じられないほど明白な間違いを誰か知っていますか?
私がこれまでに行ったこと:
- Laravelをダウンロードしてインストール
- composer.json に
"jasonlewis/basset": "dev-master"
とを追加"leafo/lessphp": "dev-master"
- を実行します
composer update
- を実行します
php artisan config:publish jasonlewis/basset
- を指すようにバセット構成を編集しました
LessphpFilter
vendor/jasonlewis/basset/src/Basset/Asset.php
Laravel 4.1 との互換性に関するバグを修正するために を編集しました。- でアプリケーションキャッシュをクリアしました
php artisan cache:clear
- 上記のLESSコードでページをロードしようとしました
less - 反復LESSの簡素化
さまざまな大学の配色をサポートできる複数のレイアウト テーマをサポートする WordPress ネットワーク用のテーマ システムを作成しています。そうするために、定期的にLESSファイルを(lessphpを使用して)学校固有の変数でコンパイルし、基本的にそれをテーマのヘルパークラスのライブラリとして使用しています。
@primary
各学校には、LESS で次の3 つの色が定義されてい@secondary
ます@tertiary
。この方法は簡単で機能的ですが、コード内で何度も繰り返す必要があります。例えば:
LESS の観点からは何も複雑ではありませんが、新しいヘルパー クラスを追加したい場合は、3 を作成する必要があります。これを達成するためのより簡潔な方法はありますか?