diff --git a/lib/outputlib.php b/lib/outputlib.php index d50d022a9b9..e3a354ebccc 100644 --- a/lib/outputlib.php +++ b/lib/outputlib.php @@ -1208,6 +1208,7 @@ class theme_config { */ public function get_css_content_debug($type, $subtype, $sheet) { + if ($type === 'scss') { // The SCSS file of the theme is requested. $csscontent = $this->get_css_content_from_scss(true); @@ -1430,9 +1431,17 @@ class theme_config { // TODO: MDL-62757 When changing anything in this method please do not forget to check // if the validate() method in class admin_setting_configthemepreset needs updating too. - + $cacheoptions = ''; + if ($themedesigner) { + $scsscachedir = $CFG->localcachedir . '/scsscache/'; + $cacheoptions = array( + 'cacheDir' => $scsscachedir, + 'prefix' => 'scssphp_', + 'forceRefresh' => false, + ); + } // Set-up the compiler. - $compiler = new core_scss(); + $compiler = new core_scss($cacheoptions); $compiler->prepend_raw_scss($this->get_pre_scss_code()); if (is_string($scss)) { $compiler->set_file($scss);