DEV Community

loading...

Discussion on: CSS coding patterns that give you away as a junior developer.

Collapse
darkwiiplayer profile image
Collapse
joelbonetr profile image
JoelBonetR

this makes your code less optimized, so in performance terms it's an issue and must be avoided

Thread Thread
darkwiiplayer profile image
DarkWiiPlayer

How so? What's less performant about *+* compared to the other ways you could express it?

Thread Thread
joelbonetr profile image
JoelBonetR
  • selects all elements so it parses multiple times to the CSSOM, as more specific a selector is, more performance when applying it. li+li will apply to all li parent elements of another li, where + will apply to any element being parent of whatever other element.