import * as parseSelector from "postcss-selector-parser" ; export function getSelectorScope ( selector ) { let selectorScope = "root" ; parseSelector ( ( nodes ) => { for ( const node of nodes . first . nodes ) { if ( node . type === "class" ) { selectorScope = node . toString ( ) ; break ; } } } ) . processSync ( selector ) ; return selectorScope ; }