mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-21 09:38:48 +02:00
Merge remote-tracking branch 'origin/support/3.0' into develop
# Conflicts: # composer.json # composer.lock # lib/composer/autoload_classmap.php # lib/composer/autoload_files.php # lib/composer/autoload_real.php # lib/composer/autoload_static.php # lib/composer/installed.php
This commit is contained in:
@@ -21,6 +21,8 @@ use Combodo\iTop\Application\Helper\Session;
|
||||
use Combodo\iTop\Application\UI\Base\iUIBlock;
|
||||
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlock;
|
||||
use ScssPhp\ScssPhp\Compiler;
|
||||
use ScssPhp\ScssPhp\OutputStyle;
|
||||
use ScssPhp\ScssPhp\ValueConverter;
|
||||
|
||||
|
||||
/**
|
||||
@@ -1940,20 +1942,25 @@ class utils
|
||||
*/
|
||||
public static function CompileCSSFromSASS($sSassContent, $aImportPaths = array(), $aVariables = array())
|
||||
{
|
||||
$oSass = new Compiler();
|
||||
$oSass->setFormatter('ScssPhp\\ScssPhp\\Formatter\\Compressed');
|
||||
$oSass = new Compiler();//['checkImportResolutions'=>true]);
|
||||
$oSass->setOutputStyle(OutputStyle::EXPANDED);
|
||||
// Setting our variables
|
||||
$oSass->setVariables($aVariables);
|
||||
$aCssVariable = [];
|
||||
foreach ($aVariables as $entry=>$value) {
|
||||
$aCssVariable[$entry] = ValueConverter::parseValue($value);
|
||||
}
|
||||
$oSass->addVariables($aCssVariable);
|
||||
// Setting our imports paths
|
||||
$oSass->setImportPaths($aImportPaths);
|
||||
// Temporary disabling max exec time while compiling
|
||||
$iCurrentMaxExecTime = (int) ini_get('max_execution_time');
|
||||
set_time_limit(0);
|
||||
// Compiling SASS
|
||||
$sCss = $oSass->compile($sSassContent);
|
||||
//checkImportResolutions
|
||||
$sCss = $oSass->compileString($sSassContent);
|
||||
set_time_limit(intval($iCurrentMaxExecTime));
|
||||
|
||||
return $sCss;
|
||||
return $sCss->getCss();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user