Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    ssyz1988
    @ssyz1988
    yes, as showed above, how to name them properly
    can u name them for me?
    Alexej Yaroshevich
    @zxqfox

    If you talking about your sample, I'd make something like:

    <div class="media">
      <img src="logo.png" alt="Foo Corp logo" class="image media__img media__img--rev">
      <div class="media__body">
        <h3 class="media__alpha">Welcome to Foo Corp</h3>
        <p class="media__lede">Foo Corp is the best, seriously!</p>
      </div>
    </div>

    Note that img has a mix of image block and media__img element with --rev modifier.

    ssyz1988
    @ssyz1988
    not my sample, your sample
    block1...3
    Alexej Yaroshevich
    @zxqfox
    They named properly. Just abstract
    Btw, you can look at gitter html sources. True bem inside
    ssyz1988
    @ssyz1988
    thanks a lot,where can i look at gitter html sources?
    gitter? i don not know it
    Alexej Yaroshevich
    @zxqfox
    Something like Ctrl+U ;-) Or via inspector/firebug
    ssyz1988
    @ssyz1988
    ok..
    Alexej Yaroshevich
    @zxqfox
    Right here: https://gitter.im/bem/talk, if you using native client
    ssyz1988
    @ssyz1988
    yes,i found it
    Alexej Yaroshevich
    @zxqfox
    You just need to know that Blocks and DOM are different trees. And if elements shouldn't be used outside of blocks (just for consistency troubles, you can use it anyway, but it's not recommended) — DOM nodes with block instances can be nested as any other DOM nodes. Simple example is a table (block) that can be nested inside another table (same block), and can have columns, rows, cells (elements), etc.
    ssyz1988
    @ssyz1988
    well,thank you.
    another question, how to show modifier? someone use _ and some one use --
    which one is right?
    • not _
    i am wrong ,someone use -
    Alexej Yaroshevich
    @zxqfox
    Both ;-) Use what you like more
    ssyz1988
    @ssyz1988
    ok
    Alexej Yaroshevich
    @zxqfox
    One more thing is tools that works atm only with block__elem_mod_val. So if you mind to use bemjson, bemhtml, and enb/bem-tools to build html then better to stick to _
    ssyz1988
    @ssyz1988
    yeah, thanks a lot
    Mike Morici
    @himedlooff
    anyone ever run into issues commenting out HTML that has class names using --? For example, <!--<div class="something--something"? Technically this is not a valid comment. https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/The_Importance_of_Correct_HTML_Commenting
    ssyz1988
    @ssyz1988
    i want get a job in usa as fe, is it easy?
    Jitendra Vyas
    @jitendravyas
    @ssyz1988 try at yelp.com
    In BEM is it suggsted to never style HTML selectors?
    Aleksei Gurianov
    @Guria
    what do you mean exactly? selectors for html tags?
    it acceptable only in cascades within block/elements. global css resets not recommended
    Jitendra Vyas
    @jitendravyas
    @Guria like h1{} h2 {}
    Alexej Yaroshevich
    @zxqfox
    Usual usage for me is (styl):
    .user-content {
      h1 { }
      h2 { }
      p { }
      // etc.
    }
    Where user-content is a helper block
    Jitendra Vyas
    @jitendravyas
    @zxqfox is it not against BEM standards?
    Alexej Yaroshevich
    @zxqfox
    A little bit. But if you have another idea how to pass html from admin panel — a lot of people will honor you ;-)
    Jitendra Vyas
    @jitendravyas
    @zxqfox Some WYSIWYG editors provides ability to add classed to user generated html during render time
    Alexej Yaroshevich
    @zxqfox
    @jitendravyas Yep, but just some. Anyway, BEM is not a religion, it's a set of rules, and we know that rules have been made to be broken. ;-)
    Feel free to adopt methodology for your needs. Just don't overdo.
    Yelena Jetpyspayeva
    @mursya
    Guys, we really encourage you to ask your questions here https://en.bem.info/forum/ and not in this chat. So that answers will be public and helpful to anyone. We used this chat room as a temporary method but now we have fully functional forum for this. Thanks! We really DO appreciate this!
    Alexej Yaroshevich
    @zxqfox
    @mursya :+1:
    Craig Muth
    @trogdoro
    I see your twitter page (https://twitter.com/bem_en) links to this chat. Maybe it should link to https://en.bem.info/forum/ instead?
    Alexej Yaroshevich
    @zxqfox
    Nice catch.
    Jitendra Vyas
    @jitendravyas
    Anyone using Bootstrap and BEM both in same project?
    Alexander Savin
    @apsavin
    Hi @jitendravyas
    Any problems with it?
    Jitendra Vyas
    @jitendravyas
    @apsavin No. I'm just asking. I want to use BEM but most of the work I get in Bootstrap only. I mean people request to use bootstrap only
    Alexej Yaroshevich
    @zxqfox
    @jitendravyas I've tryed to do that. Atm just using some blocks like glyphs
    The main problem is bootstrap has custom classes and project structure and that's hard to use just needed parts of it
    Jitendra Vyas
    @jitendravyas
    yes
    it's hard to use any new approach unless whole team is intersted in it
    Alexej Yaroshevich
    @zxqfox
    And to use it correctly we should refactor their modules (widgets/blocks), write dependencies, etc.
    ye
    Actually, it would be great if bootstrap will support BEM-like naming and file structures