From dd4670387656532675071f83325d42860e7d6073 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 15 Oct 2021 09:56:10 +0200 Subject: [PATCH] wip #4793 @0.25 --- src/Compiler/Compiler.php | 4 +++- src/Compiler/Styles.php | 14 +++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/Compiler/Compiler.php b/src/Compiler/Compiler.php index 9f82fb0..c35f8dd 100644 --- a/src/Compiler/Compiler.php +++ b/src/Compiler/Compiler.php @@ -322,7 +322,7 @@ class Compiler implements ShouldQueue, ShouldBeUnique public function addVideoJs() { - + $this->addLess('videojs/videojs'); } public function addSlideshowLibrary($inline = true) @@ -330,4 +330,6 @@ class Compiler implements ShouldQueue, ShouldBeUnique $l = ($inline ? $this->config->inlineSlideshowLibrary : $this->config->popupSlideshowLibrary); $this->addLess('slideshow/' . $l); } + + } diff --git a/src/Compiler/Styles.php b/src/Compiler/Styles.php index f1bfdf5..7219829 100644 --- a/src/Compiler/Styles.php +++ b/src/Compiler/Styles.php @@ -13,13 +13,25 @@ trait Styles protected $stylesheets = []; protected $lessSource; protected $cssfont = []; - public $lessFiles = ['fluidbook', 'videojs/videojs']; + public $lessFiles = ['fluidbook']; public function isMobileFirst() { return $this->config->mobileNavigationType === 'mobilefirst'; } + /** + * Helper function to add a unique stylesheet entry to the LESS stack for compilation + * Duplicate paths are ignored. + * @param $path string The path of the file relative to the /style folder, without any extension + */ + public function addLess($path) + { + if (!in_array($path, $this->lessFiles)) { + $this->lessFiles[] = $path; + } + } + public function addFontKit($font) { if ($font === 'sans-serif') { -- 2.39.5