Chapter 5. Inheritance, Overriding, and Nesting in Less

So far in our journey with Less, we've seen how you can begin to reduce the code you need to write; it's time to take it up a level and begin to look at some more advanced concepts within Less.

Let me begin by asking you a question: what is the one thing that irritates you about writing styles where the same selector has to be repeated many times, such as when designing a menu system using an unordered list element? Hopefully, the answer is duplicated styles. In this chapter, we will take a look at how you can group styles to avoid the need to duplicate selectors in your code. We will also cover how you can inherit styles that can have a dramatic effect on reducing duplication; I'll also provide ...

Get Learning Less.js now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.