On Writing CSS (philipcdavis.com)
over 5 years ago from Philip Davis, Designer and Developer
over 5 years ago from Philip Davis, Designer and Developer
"... I figured I would some thoughts on the type of CSS that I like to write and use."
I think you missed a word after 'would'? Nice writeup nonetheless.
HI Philip! :D
Great write up! Anyone have any input as to why nesting is to be avoided? I use it quite a lot in my own projects.
Hi Evan, i don't avoid nesting entirely, but the danger is that you have a lot of specificity variance which makes it difficult to quickly understand how styles are being applied and overridden. This is documented in Harry Robert's CSS Guidelines: https://cssguidelin.es/#specificity
Following what Philip said, this post from Slack's engineering team has a great visualization of specificity, and a description of why the team refactored the way it did.
Thanks for the clarification Clarke and Philip!
Designer News
Where the design community meets.
Designer News is a large, global community of people working or interested in design and technology.
Have feedback?
Login to Comment
You'll need to log in before you can leave a comment.
LoginRegister Today
New accounts can leave comments immediately, and gain full permissions after one week.
Register now