3 ms·
The problem they describe is nonexistent. They say <div class="card big"> is bad because some other CSS can come along and co-opt what big means Doesn
by TekMol 4y ago
The problem they describe is nonexistent. They say <div class="card big"> is bad because
some other CSS can come along
and co-opt what big means
Doesn't matter, because you would not style ".big" but ".card.big".
Yes, if someone would redefine "card", that would be a problem. That's why this "base class" should not be as short as just "card" but rather "userInfoCard" or something like that.
- leephillips 4y ago> The problem [he] describe[s] is nonexistent. [He] say[s] <div class="card big"> is bad because some other CSS can come along and co-opt what big means To me the complaint is like saying, when programming, that I shouldn’t define functions with names in a file that’s imported into another file, because “some other” file can “come along” and redefine those names. If that’s a problem then that’s your problem, not the existence of classes. Or names.
- Keithamus 4y agoNaming collisions are a pretty real problem when you get to building large systems. They’re a big enough problem for something like CSS Modules to exist (explained further down in the post).