lundi 27 juin 2016

Is it better to have more sepecific class names, or paths? [closed]


From an optimization stand point is it more efficient to have longer more specific chains like:

.first {
    /*some css*/
}

.first .second{
    /*some css*/
}

.first .second .third{
    /*some css*/
}

.first .second .third .fourth{
    /*some css*/
}

Or is it more efficient to make more unique/specific class names like:

.first {
    /*some css*/
}

.first-second{
    /*some css*/
}

.first-second-third{
    /*some css*/
}

.first-second-third-fourth{
    /*some css*/
}

Is there perhaps a tipping point somewhere where longer paths become less efficient than unique names and vice/versa ?


Aucun commentaire:

Enregistrer un commentaire