From c7039ddec48b7a607151fe5789dce124001d5d86 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Thu, 6 Feb 2025 18:20:42 -0800 Subject: [PATCH] feat(core): tailwind v4 support (#10692) --- packages/core/ui/core/properties/index.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/core/ui/core/properties/index.ts b/packages/core/ui/core/properties/index.ts index 1eedb390e..3ca9be748 100644 --- a/packages/core/ui/core/properties/index.ts +++ b/packages/core/ui/core/properties/index.ts @@ -151,7 +151,12 @@ export function _evaluateCssCalcExpression(value: string) { if (isCssCalcExpression(value)) { // WORKAROUND: reduce-css-calc can't handle the dip-unit. - return require('reduce-css-calc')(value.replace(/([0-9]+(\.[0-9]+)?)dip\b/g, '$1')); + let cssValue = value.replace(/([0-9]+(\.[0-9]+)?)dip\b/g, '$1'); + if (cssValue.includes('unset')) { + // ensure unset is properly handled before processing calc + cssValue = cssValue.replace(/unset/g, '0'); + } + return require('reduce-css-calc')(cssValue); } else { return value; } @@ -920,10 +925,10 @@ export class CssAnimationProperty implements CssAnimationPro get: getsComputed ? function (this: T) { return this[computedValue]; - } + } : function (this: T) { return this[symbol]; - }, + }, set(this: T, boxedValue: U | string) { const view = this.viewRef.get(); if (!view) {