Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (hasInlineStyles) {
const inlineRTLStyles = generateDirectionalStyles(inlineStyles);
if (inlineRTLStyles) {
// Because we know nothing about the current directional context, there
// is no way to determine whether or not the inline styles should be
// flipped. As a result, if there are inline styles to be flipped, we
// do so by converting them to classnames and providing styles in both
// an RTL and an LTR context.
// This may not work for all situations! For instance, when using inline
// styles to animate a component with react-motion or animated.js,
// converting to classes is likely to be way too slow. For those and
// other edge-cases, consumers should rely on the resolveNoRTL method
// instead.
aphroditeStyles.push({
_name: `inlineStyles_${hashObject(inlineRTLStyles)}`,
_definition: inlineRTLStyles,
});
} else {
result.style = inlineStyles;
}
}
if (aphroditeStyles.length > 0) {
result.className = css(...aphroditeStyles);
}
return result;
}
injectStyles(): string {
const { rules, fragments } = this.ruleSet.flatten()
const className = `_${hashObject({ rules, fragments })}`
injectCss(`.${className}`, rules, fragments)
return className
}
}