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 namespacing with prebuilt libraries


In this recipe, you will learn how to use different mixin libraries together and use namespaces to prevent collisions between mixins with the same name.

Getting ready

In this recipe, two mixin libraries are used: Less Elements, which can be downloaded from https://github.com/dmitryf/elements/archive/master.zip, and the Less Hat library, which can be downloaded from https://github.com/madebysource/lesshat/archive/v3.0.2.zip.

Unzip both the ZIP archives into your working directory, and use the command-line lessc compiler, as described in the Installing the lessc compiler with npm recipe in Chapter 1, Getting to Grips with the Basics of Less, to compile your Less code.

How to do it…

Write down the Less code shown here into a file, and compile the file with the command-line lessc compiler:

#lesselements {
  @import "elements-master/elements.less";
}
#lesshat {
  @import "lesshat-master/build/lesshat.less";
}
div.drop-shadow {
  #lesselements > .drop-shadow...