• What is the correct way to add less import dynamically in one file.
    Something like:

    require THEME_DIR . '/inc/plugins/wp-less/bootstrap-for-theme.php';
    if(something) {
        $WPLessPlugin->addImport('mixins1.less');
    } else {
        $WPLessPlugin->addImport('mixins2.less');
    }
    $WPLessPlugin->dispatch( );
    
    function l_scripts() {
        wp_enqueue_style('style', get_bloginfo('template_directory').'/style.less', array(), '', 'screen, projection');
    }
    add_action( 'wp', 'l_scripts' );

    Is it at least possible?

    Thanks for help.

    http://wordpress.org/extend/plugins/wp-less/

Viewing 1 replies (of 1 total)
  • Thread Starter Markjj

    (@markjj)

    I tried it adding using variables, but it doesn’t seem to work.

    in php:
    $WPLessPlugin->addVariable(''@mixins-path", "/path/mixins.less");
    
    in less:
    @import @mixins-path;
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: WP-LESS] Correct way to add @import dynamically’ is closed to new replies.