From 342a6eccf11736e8e8bea1f49f19b24a320deca7 Mon Sep 17 00:00:00 2001 From: isUnknown Date: Tue, 24 Feb 2026 14:02:33 +0100 Subject: [PATCH] fix: update Coloris color swatches in TextSettings after loading custom styles Dispatch input events on color inputs after syncFromStore so Coloris updates its ::before pseudo-element swatches with loaded values. Co-Authored-By: Claude Opus 4.6 --- .../5_test-avec-geoformat/narrative.txt | 10 +++++----- src/components/editor/TextSettings.vue | 13 +++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/public/content/1_cohesion-des-mondes/5_test-avec-geoformat/narrative.txt b/public/content/1_cohesion-des-mondes/5_test-avec-geoformat/narrative.txt index b732d56..e070ad9 100644 --- a/public/content/1_cohesion-des-mondes/5_test-avec-geoformat/narrative.txt +++ b/public/content/1_cohesion-des-mondes/5_test-avec-geoformat/narrative.txt @@ -19,7 +19,7 @@ Customcss: @page { size: A4; margin: 50mm 15mm 26mm 15mm; - background: rgba(255, 255, 255, 1); + background: rgb(227, 33, 33); } body { @@ -35,10 +35,10 @@ p { font-weight: 300; font-family: Arial; font-style: italic; - padding-top: 20mm; - padding-right: 20mm; - padding-bottom: 20mm; - padding-left: 20mm; + padding-top: 0mm; + padding-right: 0mm; + padding-bottom: 0mm; + padding-left: 0mm; } h1 { diff --git a/src/components/editor/TextSettings.vue b/src/components/editor/TextSettings.vue index de0152e..567c146 100644 --- a/src/components/editor/TextSettings.vue +++ b/src/components/editor/TextSettings.vue @@ -64,6 +64,7 @@
Arrière-plan
{ isUpdatingFromStore = false; }; +const updateColorisButtons = () => { + [colorInput.value, backgroundInput.value].forEach((input) => { + if (input) { + input.dispatchEvent(new Event('input', { bubbles: true })); + } + }); +}; + onMounted(() => { Coloris.init(); Coloris({ @@ -749,6 +761,7 @@ onMounted(() => { swatches: ['#000000', '#FFFFFF', '#FF0000', '#00FF00', '#0000FF', 'transparent'] }); syncFromStore(); + setTimeout(updateColorisButtons, 100); });