-
convert-class-name-to-css-selector:将类名转换为CSS选择器
资源介绍
获取CSS选择器
将类名转换为CSS选择器
var getCssSelector = require ( 'classname-to-css-selector' ) ;
var className1 = "container outer" ;
var className2 = "block inner decorated" ;
var el = document . createElement ( 'div' ) ;
el . className = className1 ;
var inner = document . createElement ( 'span' ) ;
inner . className = className2 ;
el . appendChild ( inner ) ;
document . body . appendChild ( el ) ;
documen