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

Introducing functions


Another useful feature of Less is its ability to work out values that should be used in CSS, as a result of calculating the answers to functions and not merely using static values.

If you are already familiar with functions in programming, you might think that using functions in Less will involve writing lots of complicated formulae. Before you put your hands up in horror, fear not—it doesn't have to be that complicated! In this section, we're going to take a look at how you can use some simple math functions to automatically calculate values, using operators and the data-uri function as the basis for some examples of the many functions available within Less.

Note

You can see the complete list of functions, on the main website at http://lesscss.org/functions/.

Creating column-based layouts

One of the many tasks that a developer has to perform is to build the outline framework for a site—this could be one of the hundreds of designs, but it is likely that it will involve the...