O'Reilly logo

Sass and Compass Designer's Cookbook by Bass Jobsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Avoiding nested selectors too deeply for more modular CSS

As discussed in the Creating more intuitive code and making inheritance clear recipe of this chapter too, you should avoid nesting selectors too deeply. The risk of nesting too deep is creating an overspecified CSS, which is not easy to maintain. In this recipe, you will learn how to prevent nesting your selectors to deep.

Getting ready

You can use the Ruby Sass compiler to compile the Sass code in this recipe into CSS code. Read the Installing Sass for command line usage recipe of Chapter 1, Getting Started with Sass, to find out how to install Ruby Sass. The scss-lint tool, as described in the Writing your code in a text editor recipe of Chapter 1, Getting Started with Sass, will be used ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required