react-diagrams
react-diagrams copied to clipboard
.bem method explanation
In the whole project, there are such .bem(-somecssclass) in classNames, but i can't figure what this method do, and how to declare the className in the css file. Somebody can helpme?
The method is defined in BaseWidget, basically it appends the selector to the className defined in specific widgets. For example, the className for DefaultNodeWidget is srd-default-node, and the title div using this.bem("__title") ended up being srd-default-node__title
BEM http://getbem.com/
Oh, now everything makes sense. Thanks man ^^