Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS BEM in Facebook example

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #236104
    rhsyg03
    Participant

    Hey guys,

    How would you guys break this up in BEM?

    Using the Facebook dropdowns at the top which has 3 nav items (notifications, friends, chat), and then dropdown content which contains content items (each notification).

    There’s no real rule with BEM to say when to start a new block so what’s everyone’s own rules that seems to be working well? For example, if you have to append a name to more than 4 items (nav-item, nav-content, nav-counter, nav-addon, nav-quick-links) do you then start a new block?

    Facebook example:

    Append the extra word for each element?

    c-site-utilities
    c-site-utilities__nav
    c-site-utilities__nav-item
    c-site-utilities__counter
    c-site-utilities__content
    c-site-utilities__content-item

    or create new blocks for each section?

    c-site-utilities
    c-site-utilities-nav
    c-site-utilities-nav__item
    c-site-utilities-nav__counter
    c-site-utilities-content
    c-site-utilities-content__item

    Thanks!

Viewing 1 post (of 1 total)
  • The forum ‘CSS’ is closed to new topics and replies.