Question

I am using less for creating css file. I am using this plugin

<?php
require "lessc.inc.php";
$less = new lessc;
$less->setVariables(array(
  "base" => "968px"
));
$less->checkedCompile("webform.less", "output.css");
?>

When I first compile this code... the base variable in webform.less is compiled and exact output is created. But when I edit base value and compile, it is not updating. Am I missing anything here in less compilation using php?

Was it helpful?

Solution

The checkedCompile() method compiles only if the input file is a different one or the output file does not already exist. You have to make use of the function compileFile() to compile it again and again..

The following code may do the trick..

<?php
require "lessc.inc.php";
$less = new lessc;
$less->setVariables(array(
  "base" => "968px"
));
$less->compileFile("webform.less", "output.css");
?>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top