Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React from 'react';
import {
createStyled as createReshadowStyled,
createCSS,
} from '@reshadow/runtime';
import coreStyled, {KEYS} from '@reshadow/core';
import stylis from 'stylis';
import styled from '.';
const globalCSS = createCSS({
parse: code => {
stylis.use(null);
return {css: stylis('', code), tokens: {}};
},
});
class GlobalStyle extends React.Component {
render() {
// eslint-disable-next-line
const {style} = this.props;
if (style) {
for (const name in style) {
document.documentElement.style.setProperty(name, style[name]);
}
}
const styledProps = ['as', 'theme'];
const blacklist = new Set([...styledProps, 'color']);
const filterProps = props => {
const nextProps = {};
const filtered = Object.create(styledProps);
Object.keys(props).forEach(prop => {
nextProps[prop] = props[prop];
if (blacklist.has(prop) || !isReactProp(prop)) {
filtered.push(prop);
}
});
return {props: nextProps, filtered};
};
const __css__ = createCSS({
elements: false,
classes: false,
attributes: true,
onlyNamespaced: true,
});
const mixin = value => {
if (value[0] === "'" || value[0] === '"' || value.indexOf(':') === -1) {
return value;
}
return __css__([value]);
};
function css() {
const str = [...arguments[0]];