WordPress'te CSS önişlemcisi (LESS) nasıl çalıştırılır?LESS WordPress'te çalışmıyor
Çocuk temamda LESS'i uygulamaya çalışıyorum. Ben variable.less
oluşturmak ve çocuk teması dizinde css/less/variable.less
yerleştirin ve başlık (çocuk teması) bu @import "variable.less"
gibi benim style.css bu .less diyoruz
<link rel="stylesheet/less" href="/wp-content/themes/themename-child/css/less/variable.less" type="text/css" />
<script src="//cdnjs.cloudflare.com/ajax/libs/less.js/2.6.1/less.min.js"></script>
ama işe yaramıyor.
Ben de bu çalıştı ... ama hiçbir şansfunction css_less(){
wp_register_script('less-js', get_template_directory_uri() . '/js/less.js');
wp_enqueue_script('less-js');
wp_register_style('less-css', get_template_directory_uri(). '/css/less/variable.less');
wp_enqueue_style('less-css');
}
add_action('wp_enqueue_scripts', 'css_less');
style.css
.box-horizontal{ padding: 1em 2em 1em 2em; margin-top: -1em; text-align: center; border: 1px solid #CCC; box-shadow: @box-shadow; background: @bg-white; border-radius: 3px; }
.box-bg{ border: 1px solid #CCC; box-shadow: @box-shadow; background: #FFF; border-radius: 3px; text-align: center; }
Bağlantı: Bir AZ-derleyici yüklü http://www.homecredit.ph/testEnvironment/mail-test/4830-2/
lessphp ayrıca kullanışlıdır: http://leafo.net/lessphp/ – admcfajn