From 98d362df2305cc48ff231f196dfed8c9fbc5ae76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?= <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Wed, 20 May 2026 22:35:04 +0900 Subject: [PATCH] Update theme.ts --- packages/frontend-shared/js/theme.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/frontend-shared/js/theme.ts b/packages/frontend-shared/js/theme.ts index 94ab5fde6c..8f409b2193 100644 --- a/packages/frontend-shared/js/theme.ts +++ b/packages/frontend-shared/js/theme.ts @@ -29,7 +29,7 @@ export type Theme = { export type CompiledTheme = Record; -const MAX_THEME_REFERENCE_DEPTH = 4; +const MAX_THEME_REFERENCE_DEPTH = 8; export const themeProps = Object.keys(lightTheme.props).filter(key => !key.startsWith('X')); @@ -76,15 +76,15 @@ function getThemeReferenceColor(theme: Theme, key: string, stack: string[], dept } function getColor(theme: Theme, val: string, stack: string[] = [], depth = 0): tinycolor.Instance { - if (depth >= MAX_THEME_REFERENCE_DEPTH) { - throw new Error('Theme reference limit exceeded'); - } - if (val[0] === '@') { // ref (prop) return getThemeReferenceColor(theme, val.substring(1), stack, depth); } else if (val[0] === '$') { // ref (const) return getThemeReferenceColor(theme, val, stack, depth); } else if (val[0] === ':') { // func + if (depth >= MAX_THEME_REFERENCE_DEPTH) { + throw new Error('Theme reference limit exceeded'); + } + const parts = val.split('<'); const funcTxt = parts.shift(); const argTxt = parts.shift();