Ganesh Babu
Ganesh Babu

Reputation: 3670

LESS php not updating css

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?

Upvotes: 0

Views: 390

Answers (1)

Ashok Gj
Ashok Gj

Reputation: 168

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");
?>

Upvotes: 1

Related Questions