diff --git a/.changeset/tonic-ui-943c.md b/.changeset/tonic-ui-943c.md new file mode 100644 index 0000000000..70e8c8604d --- /dev/null +++ b/.changeset/tonic-ui-943c.md @@ -0,0 +1,5 @@ +--- +"@tonic-ui/react": patch +--- + +fix(react/theme): fixed a logical error in the `CSSVariables` component by correcting the condition to check for empty `cssVariables` diff --git a/packages/react/src/theme/CSSVariables.js b/packages/react/src/theme/CSSVariables.js index 22dd8f09dd..dbc49e89dc 100644 --- a/packages/react/src/theme/CSSVariables.js +++ b/packages/react/src/theme/CSSVariables.js @@ -6,7 +6,7 @@ const CSSVariables = () => { const styles = useCallback((theme) => { const rootSelector = theme?.rootSelector; const cssVariables = ensurePlainObject(theme?.cssVariables); - if (!rootSelector || Object.keys(cssVariables) === 0) { + if (!rootSelector || Object.keys(cssVariables).length === 0) { return {}; } return {