Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
renderKeyframe(keyframe: Function, props: Object = {}): string {
const resolvedKeyframe = keyframe(props, renderer)
const processedKeyframe = processStyleWithPlugins(
renderer,
resolvedKeyframe,
KEYFRAME_TYPE,
props
)
const keyframeReference = JSON.stringify(processedKeyframe)
if (!renderer.cache.hasOwnProperty(keyframeReference)) {
// use another unique identifier to ensure minimal css markup
const animationName =
renderer.selectorPrefix +
generateAnimationName(++renderer.uniqueKeyframeIdentifier)
const cssKeyframe = cssifyKeyframe(
processedKeyframe,
export default function cssifyStaticStyle(
staticStyle: string | Object,
renderer: DOMRenderer
): string {
if (typeof staticStyle === 'string') {
return minifyCSSString(staticStyle)
}
const processedStaticStyle = processStyleWithPlugins(
renderer,
staticStyle,
STATIC_TYPE
)
return cssifyObject(processedStaticStyle)
}
_renderStyle(style: Object = {}, props: Object = {}): string {
const processedStyle = processStyleWithPlugins(
renderer,
style,
RULE_TYPE,
props
)
return renderer._renderStyleToClassNames(processedStyle).slice(1)
},
_renderStyleToClassNames(
renderRule(rule: Function, props: Object = {}): Object {
const style = rule(props, renderer)
const reference = JSON.stringify(style)
if (!renderer.cache.hasOwnProperty(reference)) {
const processedStyle = processStyleWithPlugins(
renderer,
rule(props, renderer),
RULE_TYPE,
props
)
renderer.cache[reference] = StyleSheet.create({
style: processedStyle,
})
renderer._emitChange({
type: RULE_TYPE,
style: processedStyle,
})
}
renderer.renderRule = (rule: Function, props: Object = {}): string => {
const processedStyle = processStyleWithPlugins(
renderer,
rule(props, renderer),
RULE_TYPE,
props
)
return renderer._renderStyleToClassNames(processedStyle, rule)
}