What is BEM?
BEM is an acronym for Block, Element, and Modifier and is a methodology for creating reusable CSS. BEM works by providing a...
For further actions, you may consider blocking this person and/or reporting abuse
You're not wrong, the modifier is just the -- at then end of the name though. I just used simple class names for the purpose of demonstration. The listItems are still elements, just elements with a modifier.
I like BEM because it makes CSS feel more like you're working with Classes and Inheritance even if its just for syntax purposes. I prefer using Sass with the SCSS syntax because it feels better organized as well. Below is how CSS would look like using SCSS
I actually plan to have a future post with SASS and SMACSS!
👏👏👏👏
Nice description, but it sure makes me wonder why people are constantly fighting CSS instead of just using it the way it handles best. What's the appeal of writing HTML like it's 2000 again?
Not sure what did you mean here by
What's the appeal of writing HTML like it's 2000 again?
. Could you please elaborate?In the early days of HTML, when CSS was not a thing and, later on, when CSS was very new and unreliable and developers were just not used to it yet, the way to style your website was through HTML tags. The advantage of CSS is that you can pull styling out of the HTML into a different document and set up axiomatic rules for how things should look on the whole website. These days, however, developers have gone back to the old style, but they've replaced tags with classes. All the styling is put in the HTML document and only some generic rules are described in CSS, effectively making for a more verbose version of what we already had in the past. I'm wondering why that is. There's clearly some appeal to this very explicit styling aproach of telling each element what it should look like, but I fail to understand what could possibly outweigh all of the benefits of a mostly axiomatic CSS structure.
This makes a lot of sense, definately going to implement it in my next project!
Great I love a naming convention, CSS can be actually madness with a zillion classes out there. I honestly feel the double underscore a little too much but I might get used to it.
Inuitcss + bem = perfect combination. :D
Good description