4 ms·
Any plan to support BEM?
by meerita 11y ago
Any plan to support BEM?
- gpmcadam 11y agoMentioned on github before https://github.com/twbs/bootstrap/issues/9366#issuecomment-22507074 https://github.com/twbs/bootstrap/issues/9366#issuecomment-2... Personally I hope they never impose such an awkward naming convention.
- mdo 11y agoNo plans :).
- paulojreis 11y agoI think it's a good idea to avoid "BEM" in such a mainstream project, since the naming pattern clearly puts some people off. However, what about the problems that BEM tries to solve? Using a naming pattern to communicate structure (element E is a "child" of block B) is a good idea (instead of e.g. a descendant or a child selector) because of: a) Performance: one class (e.g .blockB__elementE) will be faster to "match" by the browser than .blockB > .elementE /.blockB .elementE; b) Less coupling to DOM structure: to have the desired style, element E doesn't necessarily have to a child of B. Similar points can be applied to modifiers. A "btn--large" instead of "btn btn-large" seems like a good idea for performance and also to avoid conflicts (the latter class will override the first, but I wouldn't want to care with order).