@ant-design/cssinjs
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -10,7 +10,8 @@ import * as React from 'react'; | ||
export function createCache() { | ||
if (typeof document !== 'undefined') { | ||
var styles = document.body.querySelectorAll("style[".concat(ATTR_MARK, "]")); | ||
if (typeof document !== 'undefined' && document.head && document.body) { | ||
var styles = document.body.querySelectorAll("style[".concat(ATTR_MARK, "]")) || []; | ||
var firstChild = document.head.firstChild; | ||
Array.from(styles).forEach(function (style) { | ||
style[CSS_IN_JS_INSTANCE] = style[CSS_IN_JS_INSTANCE] || CSS_IN_JS_INSTANCE_ID; | ||
// Not force move if no head | ||
document.head.insertBefore(style, firstChild); | ||
@@ -17,0 +18,0 @@ }); |
@@ -27,7 +27,8 @@ "use strict"; | ||
function createCache() { | ||
if (typeof document !== 'undefined') { | ||
var styles = document.body.querySelectorAll("style[".concat(ATTR_MARK, "]")); | ||
if (typeof document !== 'undefined' && document.head && document.body) { | ||
var styles = document.body.querySelectorAll("style[".concat(ATTR_MARK, "]")) || []; | ||
var firstChild = document.head.firstChild; | ||
Array.from(styles).forEach(function (style) { | ||
style[CSS_IN_JS_INSTANCE] = style[CSS_IN_JS_INSTANCE] || CSS_IN_JS_INSTANCE_ID; | ||
// Not force move if no head | ||
document.head.insertBefore(style, firstChild); | ||
@@ -34,0 +35,0 @@ }); |
{ | ||
"name": "@ant-design/cssinjs", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Component level cssinjs resolution for antd", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
110447
2426