tailwindcss/src/util/escapeClassName.js
Adam Wathan 5e935c10f7 Remove dependency on cssesc
Makes it easier to guarantee that our escape behavior stays in line with postcss-selector-parser if their internal implementation ever changes.
2019-02-27 16:40:19 -05:00

9 lines
234 B
JavaScript

import parser from 'postcss-selector-parser'
import get from 'lodash/get'
export default function escapeClassName(className) {
const node = parser.className()
node.value = className
return get(node, 'raws.value', node.value)
}