css - How do you avoid class name collisions? -
Assume that I am creating a blog and adding a class called "post" for timeline positions. Then another developer comes and creates a Highlights section, which also has a "Post" class. Suddenly we have a collision.
I usually solve it by nesting classes and do not keep anything "global", but what I have understood is that this is not the best practice:
< Code> .main .post {background-red color; } .highlights .post {background color: green; }When I inspect the large sites CSS files, I see the weight of the global class names for the proper parts of the page, so I'm really thinking that they How to solve it. Do they search and scan the entire project for a class name before adding it? What do they do if they want to add something that already exists? For this, just changing its name really looks like bad behavior. If any
Use some form of framework / methodology that implements discipline such as or
Comments
Post a Comment