Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
support,
property.slice(9).trim()
)
classNames += renderer._renderStyleToClassNames(
value,
pseudo,
media,
combinedSupport
)
} else {
console.warn(`The object key "${property}" is not a valid nested key in Fela.
Maybe you forgot to add a plugin to resolve it?
Check http://fela.js.org/docs/basics/Rules.html#styleobject for more information.`)
}
} else {
const declarationReference = generateDeclarationReference(
property,
value,
pseudo,
media,
support
)
if (!renderer.cache.hasOwnProperty(declarationReference)) {
// we remove undefined values to enable
// usage of optional props without side-effects
if (isUndefinedValue(value)) {
renderer.cache[declarationReference] = {
className: '',
}
/* eslint-disable no-continue */
continue
css: string,
media: string = '',
support?: string = '',
cache?: Object = {}
): Object {
let decl
// This excellent parsing implementation was originally taken from Styletron and modified to fit Fela
// https://github.com/rtsao/styletron/blob/master/packages/styletron-client/src/index.js#L47
/* eslint-disable no-unused-vars,no-cond-assign */
while ((decl = DECL_REGEX.exec(css))) {
// $FlowFixMe
const [ruleSet, className, pseudo, property, value] = decl
/* eslint-enable */
const declarationReference = generateDeclarationReference(
property,
value,
pseudo,
media,
support
)
cache[declarationReference] = generateCacheEntry(
RULE_TYPE,
className,
property,
value,
pseudo,
media,
support
)