react-themed-too
Advanced tools
Comparing version 0.4.6 to 0.4.7
@@ -223,2 +223,4 @@ "use strict"; | ||
} catch (e) { | ||
console.log("\x1b[33m", "Info >>> If you're getting a property 'locals' TypeError, this usually means improper file imports", "\x1b[0m"); | ||
console.log("\x1b[33m", "Please check how you're importing the css file, named imports when they're default will result in this error.", "\x1b[0m"); | ||
console.log(e); | ||
@@ -225,0 +227,0 @@ } |
@@ -13,4 +13,3 @@ "use strict"; | ||
styles, | ||
globalCss, | ||
inserted | ||
globalCss | ||
} = GlobalContext[_const.contextSecret]; | ||
@@ -22,21 +21,13 @@ let target = { | ||
Object.keys(styles).reduce((acc, curr) => { | ||
const match = new RegExp(`${_const.contextKey}-([a-zA-Z0-9-+/]+)`, "g"); | ||
const ids = curr.split(match); | ||
const id = ids[1]; | ||
const currentCss = styles[curr].body && styles[curr].body.css ? styles[curr].body.css : false; | ||
const currentMediaQuery = styles[curr].body && styles[curr].body.mediaQuery ? styles[curr].body.mediaQuery : false; | ||
if (inserted[id]) { | ||
return acc; | ||
} else { | ||
const currentCss = styles[curr].body && styles[curr].body.css ? styles[curr].body.css : false; | ||
const currentMediaQuery = styles[curr].body && styles[curr].body.mediaQuery ? styles[curr].body.mediaQuery : false; | ||
if (currentCss) { | ||
acc.css += currentCss; | ||
if (currentCss) { | ||
acc.css += currentCss; | ||
if (currentMediaQuery) { | ||
acc.mediaQueries += currentMediaQuery; | ||
} | ||
} else if (currentMediaQuery) { | ||
if (currentMediaQuery) { | ||
acc.mediaQueries += currentMediaQuery; | ||
} | ||
} else if (currentMediaQuery) { | ||
acc.mediaQueries += currentMediaQuery; | ||
} | ||
@@ -43,0 +34,0 @@ |
{ | ||
"name": "react-themed-too", | ||
"version": "0.4.6", | ||
"version": "0.4.7", | ||
"description": "CSS in React", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
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
34826
670