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 CSS source maps to debug your code


The Less compiler merges the different Less source files into a single CSS file. This file has been minified in most cases. When you are inspecting the source of the CSS files with the developer tools of your browser, you cannot relate the style effects to your original Less code. The CSS source maps solve this problem by mapping the combined/minified file back to its unbuilt state.

Getting ready

Currently, the less.js client-side compiler does not support the SourceMap option, so you will need the command-line compiler lessc to generate CSS source maps. The Installing the lessc compiler with npm recipe in Chapter 1, Getting to Grips with the Basics of Less, shows you how to use the command-line compiler. Note that this recipe also requires you to use the latest version of Google Chrome or the Mozilla Firefox web browser. The developer tools of both browsers support CSS source maps now.

How to do it…

  1. Create the following folder and file structure:

  2. Then...