DEV Community

Discussion on: The Mysterious 'Owl' (*+*)

Collapse
 
adam_cyclones profile image
Adam Crockett πŸŒ€ • Edited

So I'm of a different school of thought these days, have you looked into BEM or ECSS at all? Specificity is powerful yes but man is it the pain point of CSS. I also am not a massive fan of * selector even if adjecent, it's slow.

* Means look at the 100s of possible known elements or attributes that COULD be a selector. I'd do this instead

.list-item:not(:first-of-type)
.list-item:not(:last-of-type) {
   // See benchmarks bellow
}

reddit.com/r/web_design/comments/5...

Collapse
 
theaswathprabhu profile image
Aswathprabhu R

I agree that high specificity selectors can sometimes be a pain point for scaled projects, and also thanks for your approach mate 😁Cheers!

Collapse
 
adam_cyclones profile image
Adam Crockett πŸŒ€

Your most welcome, I didn't just want to say no that's rubbish and not offer an alternative. The refit post has an interesting benchmark that might help everyone reach a verdict.