Andy Barnes
1 min readJul 1, 2019

--

Hey Thomas!

Yeah, the <li> to <div> example was crude, but there have been times in the past where I’ve needed to switch from <ul> to <ol> or similar. I see what you’re saying though, it’s not always a perfect science.

I am a big advocate for being verbose in class names. I think the call out above is that if we have properties on the <ul> and we use a class name, then it makes it more modular, without the worry of nested <ul> inheriting the stuff that’s only appropriate for the parent.

The usual argument against being too verbose, is the practice of adding class selectors to elements that you don’t even add properties to. My workflow is HTML first and then into CSS. So it feels right (and improves consistency in my code) to add classes to everything. It then means that if I do need to make a style change to something in the future, I have a class already available to me.

Thanks for reaching out!

--

--

Andy Barnes
Andy Barnes

Written by Andy Barnes

Front end developer who likes to design. Lover of technology, 80’s music and Dominic Toretto.

Responses (1)