Comparing version 0.1.2 to 0.1.3
@@ -64,3 +64,3 @@ /** | ||
if (style[compiledKey]) { | ||
if (style.$$css) { | ||
// Build up the class names defined by this object | ||
@@ -89,6 +89,5 @@ var classNameChunk = ''; // Check the cache to see if we've already done this work | ||
if (typeof value === 'string') { | ||
if (typeof value === 'string' || value === null) { | ||
// Only add to chunks if this property hasn't already been seen | ||
if (!definedProperties.includes(prop)) { | ||
classNameChunk += classNameChunk ? ' ' + value : value; | ||
definedProperties.push(prop); | ||
@@ -99,6 +98,10 @@ | ||
} | ||
if (typeof value === 'string') { | ||
classNameChunk += classNameChunk ? ' ' + value : value; | ||
} | ||
} | ||
} // If we encounter a value that isn't a string | ||
} // If we encounter a value that isn't a string or `null` | ||
else { | ||
console.error("styleq: ".concat(prop, " typeof ").concat(value, " is not \"string\".")); | ||
console.error("styleq: ".concat(prop, " typeof ").concat(String(value), " is not \"string\" or \"null\".")); | ||
} | ||
@@ -105,0 +108,0 @@ } // Cache: write |
{ | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"name": "styleq", | ||
@@ -40,3 +40,3 @@ "main": "styleq.js", | ||
"eslint-plugin-flowtype": "^7.0.0", | ||
"flow-bin": "^0.162.1", | ||
"flow-bin": "^0.195.2", | ||
"jest": "^27.2.4", | ||
@@ -43,0 +43,0 @@ "prettier": "^2.4.1" |
@@ -195,4 +195,4 @@ # styleQ · [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/necolas/styleq/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/styleq.svg?style=flat)](https://www.npmjs.com/package/styleq) [![Build Status](https://github.com/necolas/styleq/workflows/tests/badge.svg)](https://github.com/necolas/styleq/actions) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/necolas/styleq/blob/master/.github/CONTRIBUTING.md) | ||
opacity: 'opacity-07', | ||
focus$opacity: 'focus-opacity-08', | ||
active$opacity: 'active-opacity-1' | ||
__focus$opacity: 'focus-opacity-08', | ||
__active$opacity: 'active-opacity-1' | ||
} | ||
@@ -228,3 +228,3 @@ }; | ||
$$css: true, | ||
'xjrodmsp-opacity-1': 'xjrodmsp-opacity-1' | ||
'__xjrodmsp-opacity-1': 'xjrodmsp-opacity-1' | ||
} | ||
@@ -275,4 +275,4 @@ }; | ||
// Compiler decides that only one reset is allowed per element. | ||
// Each reset rule created is set to the '$$reset' key. | ||
$$reset: 'reset-<hash>', | ||
// Each reset rule created is set to the '__reset' key. | ||
__reset: 'reset-<hash>', | ||
}; | ||
@@ -387,3 +387,3 @@ ``` | ||
$$css: true, | ||
$$theme: 'theme-default' | ||
__theme: 'theme-default' | ||
}; | ||
@@ -476,5 +476,5 @@ | ||
$$css: true, | ||
colorScheme: 'cs-1', | ||
padding: 'p-1', | ||
size: 's-1' | ||
__cs: 'cs-1', | ||
__p: 'p-1', | ||
__s: 's-1' | ||
}; | ||
@@ -488,4 +488,4 @@ | ||
$$css: true, | ||
colorScheme: 'cs-2', | ||
padding: 'p-2' | ||
__cs: 'cs-2', | ||
__p: 'p-2' | ||
} | ||
@@ -492,0 +492,0 @@ |
@@ -11,3 +11,3 @@ /** | ||
export type CompiledStyle = { | ||
$$css: boolean, | ||
$$css: true, | ||
[key: string]: string, | ||
@@ -17,2 +17,3 @@ }; | ||
export type InlineStyle = { | ||
$$css?: empty, | ||
[key: string]: number | string, | ||
@@ -19,0 +20,0 @@ }; |
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
28252
240