diff --git a/lib/classes/scss.php b/lib/classes/scss.php index a8aa4a9..0281a95 100644 --- a/lib/classes/scss.php +++ b/lib/classes/scss.php @@ -95,7 +95,22 @@ class core_scss extends \Leafo\ScssPhp\Compiler { $content .= file_get_contents($this->scssfile); } $content .= implode(';', $this->scsscontent); - return $this->compile($content); + //return $this->compile($content); + $process = proc_open( + "/usr/local/bin/sassc -I ". implode(":", $this->importPaths) ." -s", + [ + ["pipe", "r"], + ["pipe", "w"] + ], + $pipes + ); + + if (is_resource($process)) { + fwrite($pipes[0], $content); + fclose($pipes[0]); + + return stream_get_contents($pipes[1]); + } } /** diff --git a/lib/outputlib.php b/lib/outputlib.php index 8dd54b8..940f720 100644 --- a/lib/outputlib.php +++ b/lib/outputlib.php @@ -909,7 +909,10 @@ class theme_config { } else { if ($type === 'theme' && $identifier === self::SCSS_KEY) { // We need the content from SCSS because this is the SCSS file from the theme. + $compilestart = time(); $csscontent .= $this->get_css_content_from_scss(false); + $compileend = time(); + error_log('compile time: ' . ($compileend - $compilestart)); } else if ($type === 'theme' && $identifier === $this->lessfile) { // We need the content from LESS because this is the LESS file from the theme. $csscontent .= $this->get_css_content_from_less(false); @@ -919,8 +922,16 @@ class theme_config { } } } + + $processstart = time(); $csscontent = $this->post_process($csscontent); + $processend = time(); + error_log('process time: ' . ($processend - $processstart)); + + $minifystart = time(); $csscontent = core_minify::css($csscontent); + $minifyend = time(); + error_log('minify time: ' . ($minifyend - $minifystart)); // START MOODLECLOUD HACK. $cache->set($key, $csscontent); diff --git a/theme/boost/scss/moodle/forms.scss b/theme/boost/scss/moodle/forms.scss index 899c8b8..78b4b27 100644 --- a/theme/boost/scss/moodle/forms.scss +++ b/theme/boost/scss/moodle/forms.scss @@ -153,12 +153,12 @@ div.backup-section + form, // I think this could be avoided (or at least tidied up) ifr // we used HTML5 input types like url, phone, email, number etc. /* rtl:ignore */ -.mform .fitem .felement input[name=email], -.mform .fitem .felement input[name=email2], -.mform .fitem .felement input[name=url], -.mform .fitem .felement input[name=idnumber], -.mform .fitem .felement input[name=phone1], -.mform .fitem .felement input[name=phone2] { +.mform .fitem .felement input[name="email"], +.mform .fitem .felement input[name="email2"], +.mform .fitem .felement input[name="url"], +.mform .fitem .felement input[name="idnumber"], +.mform .fitem .felement input[name="phone1"], +.mform .fitem .felement input[name="phone2"] { text-align: left; direction: ltr; } @@ -310,7 +310,7 @@ select[size], select[multiple] { overflow: auto; } -select[size=1] { +select[size="1"] { overflow: visible; }