lessImportOverrides[] = compact('file', 'newFilePath', 'extensionId'); return $this; } /** * This method allows overriding LESS file sources. * For example `forum.less`, `admin.less`, `mixins.less` and `variables.less` are file sources, * and can therefore be overriden using this method. * * @param string $file : Name of the file to override, for example: `admin.less` * @param string $newFilePath : Absolute path of the new file. * @param string|null $extensionId : If overriding an extension file, specify its ID, for example: `flarum-tags`. * @return self */ public function overrideFileSource(string $file, string $newFilePath, string $extensionId = null): self { $this->fileSourceOverrides[] = compact('file', 'newFilePath', 'extensionId'); return $this; } public function extend(Container $container, Extension $extension = null) { $container->extend('flarum.assets.factory', function (callable $factory) { return function (...$args) use ($factory) { /** @var Assets $assets */ $assets = $factory(...$args); $assets->addLessImportOverrides($this->lessImportOverrides); $assets->addFileSourceOverrides($this->fileSourceOverrides); return $assets; }; }); } }