great article. I tried to apply your technique within my new project, but I run into some problems with more complex components. As an example below, you can see my code tree for my navigation which has a megamenu dropdown.
Yes, you may find yourself creating abnormally long class names with Webflow at times.
Hopefully they add a bit more depth to the class system at some point and model it more on the way CSS is actually written… (with sub classes that work properly and an easier way to organise / delete classes…!)
You can shorten these though. Say c-nav, rather than c-navbar, and use one underscore instead of two. But yeah, technically if you’re using this method then it’s going to be c-nav-brand_link_img, the logic needs to be the same throughout so if someone else is reading or working with your code, they can get straight to it…
You could also abbreviate dropdown to c-nav-dd. Or even the menu to c-nav-m.
It doesn’t really matter how long or short they are, even though the idea of efficient coding is the most done with the least written, as long as it makes sense.
Personally I don’t use BEM. I’d just do it c-nav-menu-wrap, c-nav-menu-link, c-nav-drop, c-nav-drop-link, etc. Unless it was really complex. Why is the C there anyway?