Parse CSS custom property strings.
npm i -S parse-css-custom-property
import ParseCSSCustomProperty, {
getDeclaration,
getFallback,
} from 'parse-css-custom-property';
const cssCustomProperty = 'var(--foo, bar)';
// { declaration: '--foo', fallback: 'bar' }
ParseCSSCustomProperty(cssCustomProperty);
// '--foo'
getDeclaration(cssCustomProperty);
// 'bar'
getFallback(cssCustomProperty);