Manage Less/CSS of WordPress theme with compilation/cache on fly.
This class allows you to compile files in LESS CSS. Once compiled, the CSS is stored in a cached CSS standard.
This is the file that will be delivered to users. Whenever a file is LESS modified, the cache is invalidated and regenerated.
This class must be called by the functions.php file of the theme.
themes/my-theme/ themes/my-theme/css/ themes/my-theme/inc/ themes/my-theme/inc/style.php themes/my-theme/inc/lib/lessc.inc.php
// Declare less for style new Less_Theme_Generator( array( '/css/ressources/reset.less', '/css/ressources/text.less', '/css/ressources/forms.less', '/css/ressources/img.less', '/css/ressources/superfish.less', '/css/ressources/elements.less', '/css/ressources/grid.less', '/css/master.less' ), TEMPLATEPATH, get_bloginfo('template_directory'), false, false );
- Array with ressourcess LESS to compile
- Path to theme
- URL to theme
- Boolean for enable compression
- Boolean for enable debug (inline style, non cache)