Skip to content

Instantly share code, notes, and snippets.

@abdollahpour
Created September 25, 2013 14:57
Show Gist options
  • Save abdollahpour/6700852 to your computer and use it in GitHub Desktop.
Save abdollahpour/6700852 to your computer and use it in GitHub Desktop.
Convert LESS to CSS with PHP
<?php
require "lessc.inc.php";
$css_file = 'test.css';
if(!file_exists($css_file)) {
$less_file = preg_replace('"\.css$"', '.less', $css_file);
$less = new lessc;
$less->checkedCompile($less_file, $css_file);
}
?>
<html>
<link href="<?php echo $css_file ?>" rel="stylesheet" type="text/css" />
</html>
.block { padding: 3 + 4px }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment