Book Image

Learning less.js

Book Image

Learning less.js

Overview of this book

Table of Contents (22 chapters)
Learning Less.js
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 11. Abstracting CSS Frameworks with Less

Back in late 2011, the popular social networking site, Twitter, released Bootstrap—the framework caused such an impression, it quickly became the most followed project on GitHub!

Anybody who has spent time developing must have at least heard of Bootstrap, even if they haven't yet had a chance to use it. In the previous chapter, we took a brief look at how it uses Less to compile rules into valid CSS and how you can experiment with using one of the many mixins available to create your own styles.

The trouble is that Bootstrap as a framework is not without its own faults—it encourages us to overload HTML with dozens of classes! This goes against the trend that has developed over the last decade, where content should be separate from presentation. In this chapter, we'll see why this is bad practice and how we can fix the problem by being clever about how we use Bootstrap's mixins.

In this chapter, we will cover the following topics:

  • Discovering what...