From 841b2e156e657f6a889429448e71ae698ef1662f Mon Sep 17 00:00:00 2001 From: Juan Flores <112629487+juan-flores077@users.noreply.github.com> Date: Fri, 24 Apr 2026 00:11:31 -0700 Subject: [PATCH] :bug: Fix typography style creation with tokenized line-height (#9121) When a text element has a line-height coming from a design token, the value may be a number (e.g. 1.5) and fails frontend data validation expecting a string. Normalize line-height before creating the typography style so the operation succeeds without throwing an assertion error. Signed-off-by: juan-flores077 --- CHANGES.md | 2 +- frontend/src/app/main/data/workspace/texts.cljs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 358adbed71..cad6fe13a8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -78,7 +78,7 @@ - Fix copy to be more specific [Taiga #13990](https://tree.taiga.io/project/penpot/issue/13990) - Allow deleting the profile avatar after uploading [Github #9067](https://github.com/penpot/penpot/issues/9067) - Fix incorrect rendering when exporting text as SVG, PNG and JPG (by @edwin-rivera-dev) [Github #8516](https://github.com/penpot/penpot/issues/8516) - +- Fix typography style creation with tokenized line-height (by @juan-flores077) [Github #8479](https://github.com/penpot/penpot/issues/8479) ## 2.16.0 (Unreleased) diff --git a/frontend/src/app/main/data/workspace/texts.cljs b/frontend/src/app/main/data/workspace/texts.cljs index e3eccc05ab..bb604b3f2f 100644 --- a/frontend/src/app/main/data/workspace/texts.cljs +++ b/frontend/src/app/main/data/workspace/texts.cljs @@ -935,6 +935,12 @@ (d/concat-vec txt/text-font-attrs txt/text-spacing-attrs txt/text-transform-attrs))) + values (cond-> values + (number? (:line-height values)) + (update :line-height str) + + (number? (:letter-spacing values)) + (update :letter-spacing str)) typ-id (uuid/next) typ (-> (if multiple?