SASS Nesting
When using SASS (or SCSS, LESS) it can be very tempting to use its nesting features heavily. DONT!.
When I came into SASS from a programming world I thought nesting would be a great way to maintain scope and keep my code organized. I quickly realized that nesting more than 2 or 3 levels deep will cause massive headaches.
Instead of trying to deal with specificity in your css declarations, focus on naming your classes properly and abstracting common elements!
Written by Chris Ostrowski
Related protips
2 Responses
Why do they cause massive headaches for you?
over 1 year ago
·
While at first nesting can seem great for code clarity it can become very difficult to maintain your abstractions. You can quickly fall into too-targeted-selector-hell quickly on large projects.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Css
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#