Book Image

LESS WEB DEVELOPMENT COOKBOOK

Book Image

LESS WEB DEVELOPMENT COOKBOOK

Overview of this book

Table of Contents (19 chapters)
Less Web Development Cookbook
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using variable interpolation


People who program in PHP, Perl, or Ruby will already be familiar with variable interpolation. Variable interpolation is the use of variables in strings where the compiler replaces the variable with the value that has been assigned to it.

Getting ready

For this recipe, you will have to create an example.less file. To see what happens, you can compile this file on the client side or server side. For server-side compiling, you should have the lessc compiler installed, as described in the Installing the lessc compiler with npm recipe in Chapter 1, Getting to Grips with the Basics of Less. For client-side compiling, you will have to create an index.html file, which loads the Less file and the less.js compiler with the following code in the head section:

<link rel="stylesheet/less" type="text/css" href="less/example.less">
<script src="less.js" type="text/javascript"></script>

When you inspect the results in your browser, you will also need an example...