WordPress.org

Ready to get started?Download WordPress

Forums

WP-LESS
compile .less files into css without enqueueing?? (3 posts)

  1. saas
    Member
    Posted 1 year ago #

    Hi,
    I was wondering if I could do something like this:

    foreach($my_less_files as $less_file){
          $lessConfig->setUploadDir($less_file['output_dir']);
          $lessConfig->setUploadUrl($less_file['output_url']);
         $WPLessPlugin->processStylesheet($less_file['file_path']);
    }

    without first enqueueing it??? or with wp_register_sytle only (no enqueue)???

    as opossed to this
    wp_enqueue_style('my_css', 'path/to/my/style.css');
    * $WPLessPlugin->processStylesheet('my_css');

    ????

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

  2. oncletom
    Member
    Plugin Author

    Posted 1 year ago #

    Why would you like not to enqueuing?
    It's the recommended way of including CSS files into any template files.

  3. saas
    Member
    Posted 1 year ago #

    I am not using it on live site, I needed it for my development environment only, that's why I didn't want to enqueue it (as I have several skins compiled at same time, so in case of enqueue, they all will get loaded :(), so I wanted to play with register and then compile only registered files (filtered, only less files), and I was able to do it by forking your code and making it work for my development purposes only and its working fine so far (not ideal, but working ;))

    So my suggestion is, you should allow some helper functions etc, so if user want to register some less files himself (via filter hooks or similar), and then your plugin should accept those less files and compile as per user requirement (just an idea, not necessarily everybody will be needing it).

    Keep up the good work.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic