react-diagrams icon indicating copy to clipboard operation
react-diagrams copied to clipboard

.bem method explanation

Open mathiasbaldissera opened this issue 7 years ago • 3 comments

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?

mathiasbaldissera avatar Jul 31 '19 21:07 mathiasbaldissera

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

zacharyzhy avatar Aug 05 '19 04:08 zacharyzhy

BEM http://getbem.com/

zacharyzhy avatar Aug 05 '19 04:08 zacharyzhy

Oh, now everything makes sense. Thanks man ^^

mathiasbaldissera avatar Aug 08 '19 15:08 mathiasbaldissera