Implementation of LESS (Leaner CSS) in order to make themes development easier.
Consider this bit of code to automatically enqueue your stylesheet from your theme (or plugin):
wp_enqueue_style('mytheme', get_bloginfo('template_directory').'/style.css', array(), '', 'screen, projection');
To make it process by WP-LESS, switch to this way:
wp_enqueue_style('mytheme', get_bloginfo('template_directory').'/style.less', array(), '', 'screen, projection');
You understood well: you just need to change the extension of the file.
For the moment, it's the unique way to handle this.
Helpers will be provided soon to include LESS files in your templates in a fluent way.
Nothing special. The LESS parser is fully compliant with CSS syntax.
It means nothing will be broken so don't worry.
It's a very good moto. Since the 1.1 release, there is a special bootstrap file: bootstrap-for-theme.php.
Everything is prepared and documented inside, with examples and hint.
Just help yourself!
LESS PHP 0.3.0 introduced a native way to set variables from PHP.
If you initialized the class by yourself, do it this way:
$WPLessPlugin->addVariable('@default_color', '#fff');
If you don't manage the plugin by yourself:
WPPluginToolkitPlugin::getInstance('WPLess')->addVariable($name, $value);
And if you want to do that from a theme, with less code:
wp-less/lib/helper/ThemeHelper.php file;less_add_variable('@default_color', '#fff')LESS PHP 0.3.1. introducted a new way to register functions without subclassing the compiler.
If you initialized the class by yourself, do it this way:
$WPLessPlugin->registerFunction('double', 'lessphp_double');
If you don't manage the plugin by yourself:
WPPluginToolkitPlugin::getInstance('WPLess')->registerFunction('double', 'lessphp_double');
And if you want to do that from a theme, with less code:
wp-less/lib/helper/ThemeHelper.php file;less_register_function('double', 'lessphp_double')Notice: in this example, we assume lessphp_double is a valid PHP callback, as stated in lessphp documentation.
Requires: 2.8 or higher
Compatible up to: 3.3.2
Last Updated: 2012-1-10
Downloads: 3,485
0 of 2 support threads in the last three weeks have been resolved.
Got something to say? Need help?