Revert "Don't support dark/light mode for IE"

This reverts commit baeca33789.
This commit is contained in:
Sukhwinder Dhillon 2022-04-29 11:12:29 +02:00 committed by Johannes Meyer
parent e050ea53ee
commit f1e8280c3e
4 changed files with 11 additions and 27 deletions

View File

@ -56,12 +56,10 @@ if (in_array($path, $special)) {
switch ($path) {
case 'css/icinga.css':
$forIe11 = (bool) preg_match('/Trident\/7.0;.*rv:11/', $_SERVER['HTTP_USER_AGENT']);
Stylesheet::send(false, $forIe11);
Stylesheet::send();
exit;
case 'css/icinga.min.css':
$forIe11 = (bool) preg_match('/Trident\/7.0;.*rv:11/', $_SERVER['HTTP_USER_AGENT']);
Stylesheet::send(true, $forIe11);
Stylesheet::send(true);
exit;
case 'js/icinga.dev.js':

View File

@ -10,14 +10,8 @@ require_once 'lessphp/lessc.inc.php';
class LessParser extends lessc
{
/**
* @param bool $disableModes Disable replacing compiled Less colors with CSS var() function calls and don't inject
* light mode calls
*/
public function __construct($disableModes = false)
public function __construct()
{
if (! $disableModes) {
$this->setOption('plugins', [new Visitor()]);
}
$this->setOption('plugins', [new Visitor()]);
}
}

View File

@ -58,13 +58,10 @@ class LessCompiler
/**
* Create a new LESS compiler
*
* @param bool $disableModes Disable replacing compiled Less colors with CSS var() function calls and don't inject
* light mode calls
*/
public function __construct($disableModes = false)
public function __construct()
{
$this->lessc = new LessParser($disableModes);
$this->lessc = new LessParser();
// Discourage usage of import because we're caching based on an explicit list of LESS files to compile
$this->lessc->importDisabled = true;
}

View File

@ -106,15 +106,12 @@ class StyleSheet
/**
* Create the StyleSheet
*
* @param bool $disableModes Disable replacing compiled Less colors with CSS var() function calls and don't inject
* light mode calls
*/
public function __construct($disableModes = false)
public function __construct()
{
$app = Icinga::app();
$this->app = $app;
$this->lessCompiler = new LessCompiler($disableModes);
$this->lessCompiler = new LessCompiler();
$this->pubPath = $app->getBaseDir('public');
$this->collect();
}
@ -224,13 +221,11 @@ class StyleSheet
*
* Does not cache the stylesheet if the HTTP header Cache-Control or Pragma is set to no-cache.
*
* @param bool $minified Whether to compress the stylesheet
* @param bool $disableModes Disable replacing compiled Less colors with CSS var() function calls and don't inject
* light mode calls
* @param bool $minified Whether to compress the stylesheet
*/
public static function send($minified = false, $disableModes = false)
public static function send($minified = false)
{
$styleSheet = new self($disableModes);
$styleSheet = new self();
$request = $styleSheet->app->getRequest();
$response = $styleSheet->app->getResponse();