• Resolved deremer

    (@deremer)


    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    I use the responsive less, and some of the changes I make both in the dashboard and directly in the variables.less file (see my other post for issues there) require the responsive less to be re-compiled.

    This is a fairly easy addition and I have hacked my local copy to get it done, but of course it’d be best to include it in the main plug-in code so I can take advantage of updates.

    Here’s what I added:

    //////////CODE/////////
    
    public function compileResponsiveLess( $insBootstrapDir ) {
    
    		$sFilePathBootstrapLess = $insBootstrapDir.'less'.DS.'responsive.less';
    
    		//parse LESS
    		include_once( dirname(__FILE__).'/inc/lessc/lessc.inc.php' );
    		$oLessCompiler = new lessc( $sFilePathBootstrapLess );
    		$sCompiledCss = '';
    		try {
    			$sCompiledCss = $oLessCompiler->parse();
    
    			$sLessFile = $insBootstrapDir.'css'.DS.'bootstrap-responsive';
    			file_put_contents( $sLessFile.'.css', $sCompiledCss );
    
    			//Basic Minify
    			$sCompiledCss = str_replace(array("\r\n", "\r", "\n", "\t", '  ', '    ', '    '), '', $sCompiledCss);
    			file_put_contents( $sLessFile.'.min.css', $sCompiledCss );
    		}
    		catch ( Exception $oE ) {
    			echo "lessphp fatal error: ".$oE->getMessage();
    		}
    
    	}//compileLess
    
    //////////END CODE/////////
    
    And then at the end of the functions "processNewLessOptions" and "resetToDefaultAllLessOptions", I added the line: 
    
    $this->compileResponsiveLess($insBootstrapDir);

    I’d love to see this added in the future version!

    Thanks again for a great plugin.

    https://www.ads-software.com/extend/plugins/wordpress-bootstrap-css/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Paul

    (@paultgoodchild)

    Thanks again for the idea and of course the code contribution!

    I’ll look at adding this in for version 2.1.0 when Bootstrap itself is updated.

    Will keep you posted!
    Cheers,
    Paul.

    Plugin Author Paul

    (@paultgoodchild)

    Hey,

    Another update ??

    The code necessary for recompiling Responsive css is now in the TRUNK. I haven’t released this and wont probably until v2.1.0

    If you want it now, you can download the trunk zip file and replace your plugin with it.

    Let me know how you get on with it ??
    Cheers,
    Paul.

    Plugin Author Paul

    (@paultgoodchild)

    Decided to release v2.0.4.6 of the plugin and it contain this change.

    Let me know how it works for you.
    Cheers,
    Paul.

    Thread Starter deremer

    (@deremer)

    BTW, this works great. Thank you!!

    Plugin Author Paul

    (@paultgoodchild)

    Delighted to hear it!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: WordPress Twitter Bootstrap CSS] Compile Responsive Less as well’ is closed to new replies.