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

Extending with media queries


The CSS media queries help you to display the same content in a different way, depending on device properties, such as screen width or pixel ratio. The CSS media queries play an important role in responsive web design. In Less, @media declarations for the media queries have their own scope. This secluded scope in Less also influences how the :extend() pseudo class works inside media queries. This recipe tells why and how the :extend() pseudo class works differently when used inside a @media declaration.

Getting ready

In this recipe, you will compile some example Less code. You can use the command-line lessc compiler, as described in the Installing the lessc compiler with npm in Chapter 1, Getting to Grips with the Basics of Less, to compile this Less code. Otherwise, you can also use the client-side less.js compiler, as described in the Downloading, installing, and integrating less.js recipe in Chapter 1, Getting to Grips with the Basics of Less, to see the effect...