Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.map((utility) => {
// Call `styleWith` as if it was being used & extract the non-reset class
// (e.g. `css-1234`)
const [, emotionclassName] = benefit.styleWith(utility).split(" ")
// Remove the `css-` prefix
// (e.g. `1234`)
const [, hash] = emotionclassName.split("-")
// Get the rule as it would be inserted
// e.g. css-1234:hover{opacity:0;}
const inserted = emotion.cache.inserted[hash]
// Replae `css-1234` with `hover:opacity-0`
return inserted.replace(
emotionclassName,
utility.replace(":", "\\:").replace("/", "\\/")
)
})
.join("\n")