From 04b2404e475bf57b370a346d3d04918db2ec23cc Mon Sep 17 00:00:00 2001 From: Steve Jones Date: Wed, 5 Feb 2025 22:47:11 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Compact=20fix=20for=20color=20ge?= =?UTF-8?q?neration=20in=20theme.json=20(#3222)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix for incorrect theme.json generation of colours * Fix for theme.json color generation * Compact fix for colour theme.json generation --------- Co-authored-by: Steve Jones --- resources/js/build/wordpress.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/js/build/wordpress.js b/resources/js/build/wordpress.js index 1671125..d428071 100644 --- a/resources/js/build/wordpress.js +++ b/resources/js/build/wordpress.js @@ -210,7 +210,8 @@ export function wordpressThemeJson({ return; } - const rootContent = themeContent.slice(themeContent.indexOf('{') + 1, themeContent.lastIndexOf('}')) + const endIndex = themeContent.lastIndexOf('}'); + const rootContent = themeContent.slice(themeContent.indexOf('{') + 1, endIndex === -1 ? undefined : endIndex); const colorVariables = {} const colorVarRegex = /--color-([^:]+):\s*([^;}]+)[;}]?/g