Css .class.class or .class.class, which has better performance and maintainability? do you need to pay attention to this in actual development?

for example

<li class="list-item">
   <h1 class="title list"></h1>
</li>

use .list-item. Title {} or .title.list {}

Mar.07,2021

first of all.
there is something wrong with your name.
generally there should be only one title, while a list represents a list, these two levels. What exactly is the structure of your html?
in fact, the hardest thing about css is naming, which determines its reuse and closeness. The choice of selectors is not a problem.
for example, you want to encapsulate list item
at this time you are very clear that a list must have item,Item in list
then it is
.list .item or even .list > .item
so as to maximize the guarantee that your style will not be confused.
as for performance, I think you can forget about it. First consider reusability, write too much naturally know how to choose, naturally know where good and bad.
as for how to maintain high reusability, in fact, my own suggestion is to use scss as a preprocessor to write, and then adhere to a principle. In the past, the page source code structure was usually
page

.
.js
.html
.css/.scss

now becomes
page

.js
.html

style

.css

this structure to write. I think it is mandatory to improve reusability. When you are writing js, maybe you are writing business, but when you are writing css, you should realize that you are writing a framework (of course, if you want vue, you should consider how not to write css without introducing a style framework and all reuse is solved by components)
I am still learning, and I hope to give you some help

.

1. If your title class and list class may be reused, that is, other elements may also use these two classes, it must be written separately
2. If you just want to define the style of list, then one class is enough

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b34836-40f5e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b34836-40f5e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?