Site logo

Archived topic

Redundant tags selectors

3 replies · Started by mkjj on April 8, 2021

Viewing posts 1–4 of 4

Call me a nerd, but I always try to get the best possible scores after finishing a new website. GP does a great job. However, there are still some minor issues. Redundant tags selectors might be something that could be removed. Do you have a reason to use, for example:

.main-navigation .main-nav ul li a

instead of

.main-navigation .main-nav li a

The HTML is given by the theme, so there will never be an ordered list in the navigation.

Hi there,

thats correct the Themes markup does only container UL list elements. But there is nothing saying that a plugin or another function is not adding an OL element within the navigation container.

Its simply good semantics and keeps the CSS specific to where the theme requires it.

Removing that UL from the CSS would make no noticeable difference to performance.

Ok, makes sense. It's not about performance. But some test tools are pretty strict when it comes to such details. I agree, it's better to have some redundant selectors than missing selectors that could cause some trouble. Thanks for the explanation.

You're welcome

This archived topic is closed to new replies.