Skip to content

Commit

Permalink
Merge branch 'MDL-44597-master' of git://github.com/andrewnicols/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
marinaglancy committed Mar 25, 2014
2 parents e340030 + 5d50439 commit da1a0bc
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/outputlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1034,15 +1034,24 @@ protected function get_css_content_from_less($themedesigner) {
// Get the LESS file path.
$themelessfile = $files['theme'][$lessfile];

// Instantiate the compiler.
$compiler = new core_lessc(array(
// Setup compiler options.
$options = array(
// We need to set the import directory to where $lessfile is.
'import_dirs' => array(dirname($themelessfile) => '/'),
// Always disable default caching.
'cache_method' => false,
// Disable the relative URLs, we have post_process() to handle that.
'relativeUrls' => false,
));
);

if ($themedesigner) {
// Add the sourceMap inline to ensure that it is atomically generated.
$options['sourceMap'] = true;
$options['sourceRoot'] = 'theme';
}

// Instantiate the compiler.
$compiler = new core_lessc($options);

try {
$compiler->parse_file_content($themelessfile);
Expand Down

0 comments on commit da1a0bc

Please sign in to comment.