@vanilla-extract/sprinkles
Advanced tools
Comparing version 0.3.0 to 0.3.1
# @vanilla-extract/sprinkles | ||
## 0.3.1 | ||
### Patch Changes | ||
- [#139](https://github.com/seek-oss/vanilla-extract/pull/139) [`152a1c7`](https://github.com/seek-oss/vanilla-extract/commit/152a1c7e3a29cc074f73c37d81428a75705057b9) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Ignore undefined values in conditional objects | ||
## 0.3.0 | ||
@@ -4,0 +10,0 @@ |
@@ -77,9 +77,11 @@ 'use strict'; | ||
if (process.env.NODE_ENV !== 'production') { | ||
if (!atomicProperty.values[value].conditions[conditionName]) { | ||
throw new Error(); | ||
if (value != null) { | ||
if (process.env.NODE_ENV !== 'production') { | ||
if (!atomicProperty.values[value].conditions[conditionName]) { | ||
throw new Error(); | ||
} | ||
} | ||
classNames.push(atomicProperty.values[value].conditions[conditionName]); | ||
} | ||
classNames.push(atomicProperty.values[value].conditions[conditionName]); | ||
} | ||
@@ -142,8 +144,10 @@ } | ||
if (!atomicProperty.values[value]) { | ||
invalidPropValue(prop, value, atomicProperty.values); | ||
} | ||
if (value != null) { | ||
if (!atomicProperty.values[value]) { | ||
invalidPropValue(prop, value, atomicProperty.values); | ||
} | ||
if (!atomicProperty.values[value].conditions[conditionName]) { | ||
throw new SprinklesError(`"${prop}" has no condition named ${format(conditionName)}. Possible values are ${Object.keys(atomicProperty.values[value].conditions).map(format).join(', ')}`); | ||
if (!atomicProperty.values[value].conditions[conditionName]) { | ||
throw new SprinklesError(`"${prop}" has no condition named ${format(conditionName)}. Possible values are ${Object.keys(atomicProperty.values[value].conditions).map(format).join(', ')}`); | ||
} | ||
} | ||
@@ -150,0 +154,0 @@ } |
@@ -69,5 +69,7 @@ 'use strict'; | ||
if ( "production" !== 'production') ; | ||
if (value != null) { | ||
if ( "production" !== 'production') ; | ||
classNames.push(atomicProperty.values[value].conditions[conditionName]); | ||
classNames.push(atomicProperty.values[value].conditions[conditionName]); | ||
} | ||
} | ||
@@ -74,0 +76,0 @@ } |
@@ -73,9 +73,11 @@ function createAtomsFn(...args) { | ||
if (process.env.NODE_ENV !== 'production') { | ||
if (!atomicProperty.values[value].conditions[conditionName]) { | ||
throw new Error(); | ||
if (value != null) { | ||
if (process.env.NODE_ENV !== 'production') { | ||
if (!atomicProperty.values[value].conditions[conditionName]) { | ||
throw new Error(); | ||
} | ||
} | ||
classNames.push(atomicProperty.values[value].conditions[conditionName]); | ||
} | ||
classNames.push(atomicProperty.values[value].conditions[conditionName]); | ||
} | ||
@@ -138,8 +140,10 @@ } | ||
if (!atomicProperty.values[value]) { | ||
invalidPropValue(prop, value, atomicProperty.values); | ||
} | ||
if (value != null) { | ||
if (!atomicProperty.values[value]) { | ||
invalidPropValue(prop, value, atomicProperty.values); | ||
} | ||
if (!atomicProperty.values[value].conditions[conditionName]) { | ||
throw new SprinklesError(`"${prop}" has no condition named ${format(conditionName)}. Possible values are ${Object.keys(atomicProperty.values[value].conditions).map(format).join(', ')}`); | ||
if (!atomicProperty.values[value].conditions[conditionName]) { | ||
throw new SprinklesError(`"${prop}" has no condition named ${format(conditionName)}. Possible values are ${Object.keys(atomicProperty.values[value].conditions).map(format).join(', ')}`); | ||
} | ||
} | ||
@@ -146,0 +150,0 @@ } |
@@ -78,3 +78,5 @@ 'use strict'; | ||
for (const key in normalizedObject) { | ||
mappedObject[key] = mapFn(normalizedObject[key], key); | ||
if (normalizedObject[key] != null) { | ||
mappedObject[key] = mapFn(normalizedObject[key], key); | ||
} | ||
} | ||
@@ -81,0 +83,0 @@ |
@@ -78,3 +78,5 @@ 'use strict'; | ||
for (const key in normalizedObject) { | ||
mappedObject[key] = mapFn(normalizedObject[key], key); | ||
if (normalizedObject[key] != null) { | ||
mappedObject[key] = mapFn(normalizedObject[key], key); | ||
} | ||
} | ||
@@ -81,0 +83,0 @@ |
@@ -74,3 +74,5 @@ import { addRecipe } from '@vanilla-extract/css/recipe'; | ||
for (const key in normalizedObject) { | ||
mappedObject[key] = mapFn(normalizedObject[key], key); | ||
if (normalizedObject[key] != null) { | ||
mappedObject[key] = mapFn(normalizedObject[key], key); | ||
} | ||
} | ||
@@ -77,0 +79,0 @@ |
{ | ||
"name": "@vanilla-extract/sprinkles", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Zero-runtime atomic CSS framework for vanilla-extract", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67584
1099