このスクリプトは、基本的に.less
コードをコードに変換し.css
ます。ユーザーがjavascriptをオフにしている場合にのみ問題が発生すると思いますが、多くの人がそうしていますか?
助言がありますか?
このスクリプトは、基本的に.less
コードをコードに変換し.css
ます。ユーザーがjavascriptをオフにしている場合にのみ問題が発生すると思いますが、多くの人がそうしていますか?
助言がありますか?
Many people do (I don't have exact numbers, but IIRC less than 4%), but you are under no obligation to provide functionality without javascript. Many of the more advanced sites today do not. It depends on what you are serving and who your audience is.
Of course it's great to provide this functionality if you can. I would be more concerned about the effect less.js will have on your site's load time. If you can't load the CSS until after the javascript, you have to delay rendering until the javascript runs, in order to avoid an unseemly transition from unstyled to styled.
You can have your .less files auto-compile into CSS whenever they are changed by using tools that watch directories.
他のオプションは、サーバーで独自の少ないコンパイラを作成することであり、キャッシュ時間のCSS結果で「遊ぶ」ことができます。
そのために、ライブラリを LessPHP としてチェックすることができます。
それは、あなたが何を構築しているか、そしてあなたのターゲットオーディエンスが誰であるかに大きく依存します. HTML5 をサポートする最新のブラウザーは、生成された CSS を最初にロードするときにキャッシュするので、訪問者の大部分が最新のブラウザーを使用している場合でも安全です。