Apply palettes to shared layouts and template pages

This commit is contained in:
2026-11-28 12:37:25 +08:00
parent 1aaf3908af
commit 70a94dd394
15 changed files with 104 additions and 27 deletions
+3 -1
View File
@@ -1,4 +1,5 @@
<?php
use App\Content\DesignLibrary;
use App\Content\View;
$e = View::escape(...);
@@ -8,7 +9,8 @@ $e = View::escape(...);
<select id="<?= $e($id) ?>" name="palette_id">
<?php foreach ($options as $option): ?>
<?php $cssId = $option['cssId'] ?? $option['id']; ?>
<option value="<?= $e($option['id']) ?>" data-palette-css="<?= $cssId ? '/palette/' . $e($cssId) . '.css?v=' . $e($option['version']) : '' ?>"<?= (string) $selected === (string) $option['id'] ? ' selected' : '' ?>><?= $e($option['name']) ?></option>
<?php $region = $option['region'] ?? false; ?>
<option value="<?= $e($option['id']) ?>" data-palette-css="<?= $cssId ? $e(DesignLibrary::paletteUrl($cssId, $option['version'], $region)) : '' ?>"<?= $region ? ' data-palette-region' : '' ?><?= (string) $selected === (string) $option['id'] ? ' selected' : '' ?>><?= $e($option['name']) ?></option>
<?php endforeach ?>
</select>
<details class="palette-picker" hidden>