To BEM or not to BEM, that shouldn't even be a question :)

Поделиться
HTML-код
  • Опубликовано: 2 июн 2024
  • From resent feedback, some viewers still appear to think that using BEM is either difficult, or that you have to pay for a plugin to use it.
    Both are incorrect. BEM is simply a sensible naming convention for CSS class names.
    It makes them more readable, and easier to name. Also, it i so broadly accepted that other developers can quickly and easily understand what each class's purpose is.
    With Bricks Builder being class based builder, in my view, whether to use BEM naming shouldn't be a question.
    If you don't agree, please let me know why in the comments.
    getbem.com/
  • ХоббиХобби

Комментарии • 17

  • @jean-paulmesserli8269
    @jean-paulmesserli8269 27 дней назад +1

    hurray, that was my question for a while. Thanks for the video

  • @ysintos
    @ysintos 27 дней назад +3

    This is a quite good example of how BEM is used. Can you make similar videos of how to use BEm with Advanced Themer and ACSS, as the next step to this one ?

    • @wpeasy
      @wpeasy  27 дней назад +1

      Ha.. too funny. If I make videos with ACSS and AT some users complain. When I don't, others ask for it :)
      I think we will try to get a live call going with someone who does lives

    • @nmg2023nmg
      @nmg2023nmg 27 дней назад +1

      I need a vidfeo on this aswell :)

  • @ThierryC-te3rx
    @ThierryC-te3rx 26 дней назад +1

    Great title ! 😅

  • @sevenelven
    @sevenelven 27 дней назад +1

    But then how do you give your section and container elements a selector, do you treat it as a block like .my-section or an element .my-section__container? I don't get why youtube channels who talk about BEM don't tackle this specific question, the example is always about card, like i mean yeah card is an easy example but tell us something we don't know.

    • @wpeasy
      @wpeasy  27 дней назад

      This was not intended as a comprehensive BEM application tutorial, just the basics.
      The application of BEM is subjective and opinions vary on how to apply it. This would probably be better served as a live were viewer can ask questions and make comments.
      I'll reach out to a couple of people who do lives and see it they are interested.

    • @sevenelven
      @sevenelven 27 дней назад

      @@wpeasy Apologies for the rude comment that I made, just to clarify it was not directed at you but more like in a general sense. And I for one would be interested in lives

    • @wpeasy
      @wpeasy  27 дней назад +1

      @@sevenelven All good, I didn't take it as rude :)

    • @mrkoetje
      @mrkoetje 24 дня назад +1

      My thoughts as well. Have you found good info on this?

    • @wpeasy
      @wpeasy  24 дня назад +1

      @@mrkoetje There are no hard and fast rules for this. It comes down to your own interpretation and implementation. BEM is the naming basics, apply it how it makes sense to you.
      I'm chatting with @Mark Szymanski later this morning. We will be arranging a live to discuss this and a Q&A. We will probably update in the Bricks FB group once we arrange timing.

  • @erling5148
    @erling5148 10 часов назад

    Nice but i do have a question
    You name it
    .card__header
    .card__heading
    Wy did you not name the heading .card__header-heading
    as you did with .card__bodytext

    • @wpeasy
      @wpeasy  3 часа назад +1

      I try to keep naming as simple as I can.
      There is only likely to be one header, so naming it block-name__header is OK. If you have another header, it may be block-name__sub-beader.
      With elements like Icons, Text etc. there is likely to be multiple of them. In this case, my first preference is to add its wrapper name e.g. block-name__header-icon, block-name__footer-icon
      So it depends on your structure and how many of an element type you may have. My default is to keep the names as simple as possible wherever I can.
      The thing to keep in mind is that Elements are related to the Block, not their parent wrapper. You only need to add the parent wrapper name to the class if it may class with another Element.