From 6452801cdf4406ba1945eca3ba9905237158adca Mon Sep 17 00:00:00 2001 From: Henjo Hoeksma Date: Thu, 19 Nov 2026 09:09:44 +0100 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20support=20Neos=209=20and=20pin=20Neo?= =?UTF-8?q?s=208.3=E2=80=939.x=20constraints?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Cast Site::getNodeName() to string (SiteNodeName object in Neos 9) - Skip empty excludedPaths entries; the default `-` excluded every CSS file - Require neos/flow and neos/neos ^8.3 || ^9.0 instead of * - Require symfony/finder explicitly (was only a transitive dependency) --- Classes/Module/Controller/BackendController.php | 2 +- Classes/Service/ReadCSsVariablesService.php | 17 ++++++++++++----- composer.json | 5 +++-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Classes/Module/Controller/BackendController.php b/Classes/Module/Controller/BackendController.php index 7090f12..01c69bb 100644 --- a/Classes/Module/Controller/BackendController.php +++ b/Classes/Module/Controller/BackendController.php @@ -88,7 +88,7 @@ public function saveAction(array $variables, array $default, string $site): void */ public function restoreAction(Site $site): void { - $this->writeCssVariablesService->cleanCustomCss($site->getNodeName()); + $this->writeCssVariablesService->cleanCustomCss((string)$site->getNodeName()); $this->redirect('index'); } diff --git a/Classes/Service/ReadCSsVariablesService.php b/Classes/Service/ReadCSsVariablesService.php index b6c42be..c157f58 100644 --- a/Classes/Service/ReadCSsVariablesService.php +++ b/Classes/Service/ReadCSsVariablesService.php @@ -60,8 +60,11 @@ public function readCssVariables() /** @var Site $site */ foreach ($this->siteRepository->findAll() as $site) { + // Neos 8 returns a string, Neos 9 a SiteNodeName value object + $siteNodeName = (string)$site->getNodeName(); + // Load the override values - $files = $this->getCustomCssVariables($site->getNodeName()); + $files = $this->getCustomCssVariables($siteNodeName); if ($this->getCssFiles()) { foreach ($this->getCssFiles() as $file) { if (!empty($this->readVariables($file)) && !str_starts_with($file->getRelativePathname(), 'Private')) { @@ -73,13 +76,13 @@ public function readCssVariables() } } - $result[$site->getNodeName()]['cssfile'] = []; + $result[$siteNodeName]['cssfile'] = []; foreach (array_reverse($files) as $file) { - $result[$site->getNodeName()]['cssfile'] = Arrays::arrayMergeRecursiveOverrule($result[$site->getNodeName()]['cssfile'], $file); + $result[$siteNodeName]['cssfile'] = Arrays::arrayMergeRecursiveOverrule($result[$siteNodeName]['cssfile'], $file); } - if (empty($result[$site->getNodeName()]['cssfile'])) $result[$site->getNodeName()]['error'] = 'No css variables found'; + if (empty($result[$siteNodeName]['cssfile'])) $result[$siteNodeName]['error'] = 'No css variables found'; } @@ -258,7 +261,11 @@ private function getCssFiles(): array|Finder|null // Manually filter out files from the excluded paths $finder->filter(function (\SplFileInfo $file) { - foreach ($this->excludedPaths as $excludedPath) { + foreach ($this->excludedPaths ?? [] as $excludedPath) { + // An empty entry (the default `-` in Settings.yaml) would match every path + if (empty($excludedPath)) { + continue; + } if (str_contains($file->getRealPath(), $excludedPath)) { return false; // Exclude this file } diff --git a/composer.json b/composer.json index 3dff251..a479556 100644 --- a/composer.json +++ b/composer.json @@ -4,8 +4,9 @@ "name": "theme/cssvariables", "license": "MIT", "require": { - "neos/flow": "*", - "neos/neos": "*" + "neos/flow": "^8.3 || ^9.0", + "neos/neos": "^8.3 || ^9.0", + "symfony/finder": "^7.0 || ^8.0" }, "autoload": { "psr-4": { From 4a2e2f254dc98942026369eb4d993880a6d435fb Mon Sep 17 00:00:00 2001 From: Henjo Hoeksma Date: Thu, 19 Nov 2026 09:39:56 +0100 Subject: [PATCH 2/3] fix: render overrides inline instead of publishing a symlinked stylesheet - Store overrides only in Data/Persistent; no symlink in the package directory - Render them as ` + renderer.@if.hasCss = ${!String.isBlank(props.css)} @position = 'after stylesheets' } } From 5870fe103216e50658db53fe6e0c1c87d5acb963 Mon Sep 17 00:00:00 2001 From: Henjo Hoeksma Date: Thu, 19 Nov 2026 09:53:55 +0100 Subject: [PATCH 3/3] docs: changelog for 0.3.0 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 233aa7d..915f9a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). -## Unreleased +## [0.3.0](https://github.com/hphoeksma/theme.cssvariables/compare/0.2.3...0.3.0) - 2026-11-19 ### Added