From ad9099509d299fcb308b855bd410529e73ad0b32 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 10 Nov 2020 15:27:59 +0100 Subject: [PATCH] StyleSheet: Load css assets from loaded libraries --- library/Icinga/Web/StyleSheet.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/library/Icinga/Web/StyleSheet.php b/library/Icinga/Web/StyleSheet.php index 86e43b192..1968f4537 100644 --- a/library/Icinga/Web/StyleSheet.php +++ b/library/Icinga/Web/StyleSheet.php @@ -26,7 +26,7 @@ class StyleSheet * * @var string[] */ - protected static $lessFiles = array( + protected static $lessFiles = [ '../application/fonts/fontello-ifont/css/ifont-embedded.css', 'css/vendor/normalize.css', 'css/vendor/tipsy.css', @@ -53,7 +53,7 @@ class StyleSheet 'css/icinga/print.less', 'css/icinga/responsive.less', 'css/icinga/modal.less' - ); + ]; /** * Application instance @@ -93,6 +93,12 @@ class StyleSheet */ protected function collect() { + foreach ($this->app->getLibraries() as $library) { + foreach ($library->getCssAssets() as $lessFile) { + $this->lessCompiler->addLessFile($lessFile); + } + } + foreach (self::$lessFiles as $lessFile) { $this->lessCompiler->addLessFile($this->pubPath . '/' . $lessFile); }