K
K
Kitana2015-11-10 16:46:17
css
Kitana, 2015-11-10 16:46:17

What is the best way to name a css class? What exactly should the css class name describe?

There is a navbar on the flexbox. The left part is compressed in it (a name that can be cut off) when there is little space, and the right part is not (pagination, which can be of different sizes in different cases).
Schematically:

<div class="navbar">
  <div class="navbar__part">Длинное им..</div>
  <div class=""navbar__part">1 2 3 4 5</div>
</div>

What is the best way to name parts and why?
Left and right? (mod-left, mod-right)
Shrinkable and non-shrinkable? (mod-shrinkable, mod-grown)
Or essentially: title and pagination?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Ineshin, 2015-11-10
@IonDen

Essentially.
Mods are only needed when the same elements often take on a different look. Your pagination will always be the same. Don't abstract too much, it's a trap.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question