$files[] = $customCustomSCSSFile;
}
- $scss = $this->bootstrap();
+ $scss = "/*!\n\nstylesheet for '" . $styleName . "', generated on " . \gmdate('r') . " -- DO NOT EDIT\n\n*/\n";
+ $scss .= $this->bootstrap();
foreach ($files as $file) {
$scss .= $this->prepareFile($file);
}
$variables
);
- $header = "/* stylesheet for '" . $styleName . "', generated on " . \gmdate('r') . " -- DO NOT EDIT */";
-
- $css = $this->injectHeader($header, $css);
-
$this->writeCss(FileUtil::addTrailingSlash($testFileDir) . 'style', $css);
} catch (\Exception $e) {
return $e;
$parameters = ['scss' => ''];
EventHandler::getInstance()->fireAction($this, 'compile', $parameters);
- $scss = $this->bootstrap();
+ $scss = "/*!\n\nstylesheet for '" . $style->styleName . "', generated on " . \gmdate('r') . " -- DO NOT EDIT\n\n*/\n";
+ $scss .= $this->bootstrap();
foreach ($this->getFiles() as $file) {
$scss .= $this->prepareFile($file);
}
$variables
);
- $header = "/* stylesheet for '" . $style->styleName . "', generated on " . \gmdate('r') . " -- DO NOT EDIT */";
-
- $css = $this->injectHeader($header, $css);
-
$this->writeCss($this->getFilenameForStyle($style), $css);
}
$variables['style_image_path'] = "'../images/'";
- $scss = $this->bootstrap();
+ $scss = "/*!\n\nstylesheet for the admin panel, generated on " . \gmdate('r') . " -- DO NOT EDIT\n\n*/\n";
+ $scss .= $this->bootstrap();
foreach ($files as $file) {
$scss .= $this->prepareFile($file);
}
$css = \str_replace('../icon/', '../../icon/', $css);
$css = \preg_replace('~\.\./images/~', '../../images/', $css);
- $header = "/* stylesheet for the admin panel, generated on " . \gmdate('r') . " -- DO NOT EDIT */";
-
- $css = $this->injectHeader($header, $css);
-
$this->writeCss(WCF_DIR . 'acp/style/style', $css);
}
- /**
- * Injects the given header string into the given css while ensuring
- * that the charset at-rule remains at the beginning.
- */
- private function injectHeader(string $header, string $css): string
- {
- // Strip charset at-rule.
- $css = \preg_replace('~^@charset "UTF-8";\r?\n~', '', $css);
-
- return '@charset "UTF-8";' . "\n\n{$header}\n\n{$css}";
- }
-
/**
* Returns a list of common stylesheets provided by the core.
*