From 9268c8db8ef7b35682e649bc0a2a91b33e65ca7d Mon Sep 17 00:00:00 2001 From: Margarida Silva Date: Tue, 4 Jul 2023 16:45:42 +0100 Subject: [PATCH] [fix](@svelteui/core): small fix for variants sanitization in create-styles --- packages/svelteui-core/src/styles/engine/create-styles.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/svelteui-core/src/styles/engine/create-styles.ts b/packages/svelteui-core/src/styles/engine/create-styles.ts index 049baf0a..4d15db0b 100644 --- a/packages/svelteui-core/src/styles/engine/create-styles.ts +++ b/packages/svelteui-core/src/styles/engine/create-styles.ts @@ -56,9 +56,10 @@ function sanitizeCss(object: DirtyObject, theme: SvelteUITheme) { const classMap = {}; const _sanitizeVariants = (obj: Record) => { - const variants = Object.keys(obj.variation); + const variantsObject = obj.variation ?? obj; + const variants = Object.keys(variantsObject); for (const variant of variants) { - _sanitize(obj.variation[variant]); + _sanitize(variantsObject[variant]); } };