cross-posted from: https://programming.dev/post/1923251

Some frontend developers know the BEM methodology as a naming convention for CSS and they create a disgusting #webcomponents. I’ve explain the essence of BEM and shown the benefits for your frontend projects.

Feel free to share it with a people who tells you “i use CSS-modules, so i no needs a BEM”

  • FoxBJK
    link
    fedilink
    English
    arrow-up
    3
    ·
    1 year ago

    I like BEM in theory, but whenever I actually dive in and start setting up the naming scheme what I end up with are some really long and convoluted identifiers that don’t always make things easier to organize.

    • vitonsky@programming.devOP
      link
      fedilink
      arrow-up
      1
      arrow-down
      2
      ·
      1 year ago

      As i shown in blog post, the BEM power is a code decoupling and features composing ability in a typescript/javascript code. CSS naming strategy is just a small part of BEM. BEM also works great for native mobile applications where CSS does not exist at all

      • FoxBJK
        link
        fedilink
        English
        arrow-up
        3
        ·
        1 year ago

        Yes I get that, just not a fan of what it ends up looking like. Feels like more effort than necessary for what’s really just a naming scheme.