Book Image

LESS WEB DEVELOPMENT ESSENTIALS

By : Bass Jobsen
Book Image

LESS WEB DEVELOPMENT ESSENTIALS

By: Bass Jobsen

Overview of this book

Less is a CSS preprocessor that essentially improves the functionality of simple CSS with the addition of several features. The book begins by teaching you how Less facilitates the process of web development. You will quickly then move on to actually creating your first layout using Less and compiling your very first Less code. Next, you will learn about variables and mixins and how they will help in building robust CSS code. In addition, you'll learn how to keep your code clean and test it by using style guides. We will then move on to the concept of Bootstrapping and the strength of using Less with Twitter Bootstrap. Going one step further, you will be able to customize Twitter's Bootstrap 3 using Less. Finally, you will learn how to integrate Less into your WordPress themes and explore other web apps that use Less. By leveraging this powerful CSS preprocessor, you will be able to consistently produce amazing web applications while making CSS code development an enjoyable experience.
Table of Contents (15 chapters)
Less Web Development Essentials
Credits
Foreword
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Property merging


Property merging is useful if properties accept a Comma Separated Value (CSV). You will find this type of property mostly in CSS3, where borders, backgrounds, and transitions accept a CSV list. However, you will also find that the old-school font-family parameter accepts a list of font names that are separated by commas. Properties are merged by adding a plus sign (+) after their names, as shown in the following code:

.alternative-font()
{
  font-family+: Georgia,Serif;
}
.font()
{
  font-family+: Arial;
  .alternative-font;
}
body {
.font;
}

This code will get compiled into the following code:

body {
  font-family: Arial, Georgia,Serif;
}